Public Member Functions | |
def | __init__ |
def | down |
def | drag |
def | getconstrain |
def | matrix |
def | next |
def | place |
def | setaxes |
def | setconstrain |
Private Attributes | |
_axes | |
_axis | |
_center | |
_constrain | |
_qdown | |
_qnow | |
_qpre | |
_radius | |
_vdown |
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.setconstrain(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 1496 of file transformations.py.
def semanticmodel.transformations.Arcball.__init__ | ( | self, | |
initial = None |
|||
) |
Initialize virtual trackball control. initial : quaternion or rotation matrix
Definition at line 1520 of file transformations.py.
def semanticmodel.transformations.Arcball.down | ( | self, | |
point | |||
) |
Set initial cursor window coordinates and pick constrain-axis.
Definition at line 1573 of file transformations.py.
def semanticmodel.transformations.Arcball.drag | ( | self, | |
point | |||
) |
Update current cursor window coordinates.
Definition at line 1583 of file transformations.py.
Return state of constrain to axis mode.
Definition at line 1569 of file transformations.py.
def semanticmodel.transformations.Arcball.matrix | ( | self | ) |
Return homogeneous rotation matrix.
Definition at line 1601 of file transformations.py.
def semanticmodel.transformations.Arcball.next | ( | self, | |
acceleration = 0.0 |
|||
) |
Continue rotation in direction of last drag.
Definition at line 1596 of file transformations.py.
def semanticmodel.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 1545 of file transformations.py.
def semanticmodel.transformations.Arcball.setaxes | ( | self, | |
axes | |||
) |
Set axes to constrain rotations.
Definition at line 1558 of file transformations.py.
def semanticmodel.transformations.Arcball.setconstrain | ( | self, | |
constrain | |||
) |
Set state of constrain to axis mode.
Definition at line 1565 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.
Definition at line 1524 of file transformations.py.