Public Member Functions | Private Attributes | List of all members
pyexotica.transformations.Arcball Class Reference
Inheritance diagram for pyexotica.transformations.Arcball:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, initial=None)
 
def constrain (self)
 
def constrain (self, value)
 
def down (self, point)
 
def drag (self, point)
 
def matrix (self)
 
def next (self, acceleration=0.0)
 
def place (self, center, radius)
 
def setaxes (self, axes)
 

Private Attributes

 _axes
 
 _axis
 
 _center
 
 _constrain
 
 _qdown
 
 _qnow
 
 _qpre
 
 _radius
 
 _vdown
 

Detailed Description

Virtual Trackball Control.

>>> ball = Arcball()
>>> ball = Arcball(initial=numpy.identity(4))
>>> ball.place([320, 320], 320)
>>> ball.down([500, 250])
>>> ball.drag([475, 275])
>>> R = ball.matrix()
>>> numpy.allclose(numpy.sum(R), 3.90583455)
True
>>> ball = Arcball(initial=[1, 0, 0, 0])
>>> ball.place([320, 320], 320)
>>> ball.setaxes([1, 1, 0], [-1, 1, 0])
>>> ball.constrain = True
>>> ball.down([400, 200])
>>> ball.drag([200, 400])
>>> R = ball.matrix()
>>> numpy.allclose(numpy.sum(R), 0.2055924)
True
>>> ball.next()

Definition at line 1515 of file transformations.py.

Constructor & Destructor Documentation

def pyexotica.transformations.Arcball.__init__ (   self,
  initial = None 
)
Initialize virtual trackball control.

initial : quaternion or rotation matrix

Definition at line 1539 of file transformations.py.

Member Function Documentation

def pyexotica.transformations.Arcball.constrain (   self)
Return state of constrain to axis mode.

Definition at line 1585 of file transformations.py.

def pyexotica.transformations.Arcball.constrain (   self,
  value 
)
Set state of constrain to axis mode.

Definition at line 1590 of file transformations.py.

def pyexotica.transformations.Arcball.down (   self,
  point 
)
Set initial cursor window coordinates and pick constrain-axis.

Definition at line 1594 of file transformations.py.

def pyexotica.transformations.Arcball.drag (   self,
  point 
)
Update current cursor window coordinates.

Definition at line 1604 of file transformations.py.

def pyexotica.transformations.Arcball.matrix (   self)
Return homogeneous rotation matrix.

Definition at line 1622 of file transformations.py.

def pyexotica.transformations.Arcball.next (   self,
  acceleration = 0.0 
)
Continue rotation in direction of last drag.

Definition at line 1617 of file transformations.py.

def pyexotica.transformations.Arcball.place (   self,
  center,
  radius 
)
Place Arcball, e.g. when window size changes.

center : sequence[2]
    Window coordinates of trackball center.
radius : float
    Radius of trackball in window coordinates.

Definition at line 1564 of file transformations.py.

def pyexotica.transformations.Arcball.setaxes (   self,
  axes 
)
Set axes to constrain rotations.

Definition at line 1577 of file transformations.py.

Member Data Documentation

pyexotica.transformations.Arcball._axes
private

Definition at line 1546 of file transformations.py.

pyexotica.transformations.Arcball._axis
private

Definition at line 1545 of file transformations.py.

pyexotica.transformations.Arcball._center
private

Definition at line 1548 of file transformations.py.

pyexotica.transformations.Arcball._constrain
private

Definition at line 1550 of file transformations.py.

pyexotica.transformations.Arcball._qdown
private

Definition at line 1552 of file transformations.py.

pyexotica.transformations.Arcball._qnow
private

Definition at line 1562 of file transformations.py.

pyexotica.transformations.Arcball._qpre
private

Definition at line 1562 of file transformations.py.

pyexotica.transformations.Arcball._radius
private

Definition at line 1547 of file transformations.py.

pyexotica.transformations.Arcball._vdown
private

Definition at line 1549 of file transformations.py.


The documentation for this class was generated from the following file:


exotica_python
Author(s):
autogenerated on Mon Feb 22 2021 03:33:27