class documentation
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 |