class documentation

class Arcball(object):

Constructor: Arcball(initial)

View In Hierarchy

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=[0, 0, 0, 1])
>>> ball.place([320, 320], 320)
>>> ball.setaxes([1,1,0], [-1, 1, 0])
>>> ball.setconstrain(True)
>>> ball.down([400, 200])
>>> ball.drag([200, 400])
>>> R = ball.matrix()
>>> numpy.allclose(numpy.sum(R), 0.2055924)
True
>>> ball.next()
Method __init__ Initialize virtual trackball control.
Method down Set initial cursor window coordinates and pick constrain-axis.
Method drag Update current cursor window coordinates.
Method getconstrain Return state of constrain to axis mode.
Method matrix Return homogeneous rotation matrix.
Method next Continue rotation in direction of last drag.
Method place Place Arcball, e.g. when window size changes.
Method setaxes Set axes to constrain rotations.
Method setconstrain Set state of constrain to axis mode.
Instance Variable _axes Undocumented
Instance Variable _axis Undocumented
Instance Variable _center Undocumented
Instance Variable _constrain Undocumented
Instance Variable _qdown Undocumented
Instance Variable _qnow Undocumented
Instance Variable _qpre Undocumented
Instance Variable _radius Undocumented
Instance Variable _vdown Undocumented
def __init__(self, initial=None):

Initialize virtual trackball control.

initial : quaternion or rotation matrix

def down(self, point):

Set initial cursor window coordinates and pick constrain-axis.

def drag(self, point):

Update current cursor window coordinates.

def getconstrain(self):

Return state of constrain to axis mode.

def matrix(self):

Return homogeneous rotation matrix.

def next(self, acceleration=0.0):

Continue rotation in direction of last drag.

def 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.
def setaxes(self, *axes):

Set axes to constrain rotations.

def setconstrain(self, constrain):

Set state of constrain to axis mode.

_axes =

Undocumented

_axis =

Undocumented

_center: list[float] =

Undocumented

_constrain =

Undocumented

_qdown =

Undocumented

_qnow =

Undocumented

_qpre =

Undocumented

_radius =

Undocumented

_vdown =

Undocumented