Assimp  v4.1. (December 2018)
transformations.Arcball Class Reference

Inherits object.

Public Member Functions

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

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

Constructor & Destructor Documentation

◆ __init__()

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

initial : quaternion or rotation matrix

Member Function Documentation

◆ down()

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

◆ drag()

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

◆ getconstrain()

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

◆ matrix()

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

◆ next()

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

◆ place()

def 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.

◆ setaxes()

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

◆ setconstrain()

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

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