Link Search Menu Expand Document

Class Arcball

About :

	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()

Class diagram of class of Arcball.

Functions

Function summury
__init__(self, initial=None) Initialize virtual trackball control. (more…)
place(self, center, radius) Place Arcball, e.g. when window size changes. (more…)
setaxes(self, *axes) Set axes to constrain rotations. (more…)
setconstrain(self, constrain) Set state of constrain to axis mode. (more…)
getconstrain(self) Return state of constrain to axis mode. (more…)
down(self, point) Set initial cursor window coordinates and pick constrain-axis. (more…)
drag(self, point) Update current cursor window coordinates. (more…)
next(self, acceleration=0.0) Continue rotation in direction of last drag. (more…)
matrix(self) Return homogeneous rotation matrix. (more…)

Methods desciption :

init

def __init__(self, initial=None)

Initialize virtual trackball control.

initial : quaternion or rotation matrix

place

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.

setaxes

def setaxes(self, *axes)

Set axes to constrain rotations.

setconstrain

def setconstrain(self, constrain)

Set state of constrain to axis mode.

getconstrain

def getconstrain(self)

Return state of constrain to axis mode.

down

def down(self, point)

Set initial cursor window coordinates and pick constrain-axis.

drag

def drag(self, point)

Update current cursor window coordinates.

next

def next(self, acceleration=0.0)

Continue rotation in direction of last drag.

matrix

def matrix(self)

Return homogeneous rotation matrix.