ArcBall Class

From TouchDesigner 099 Wiki

Encapsulates many aspects of 3D viewer interaction. Rotation via arcball, translation and scale.

a = tdu.ArcBall(forCamera=False)


Members

No operator specific members.


Methods

beginPan(u, v)

Begin a pan at at the given u and v.
 m.beginPan(.1, .2)

beginRotate(u, v)

Begin an arcball rotation at the given u and v.
 m.beginRotate(.1, .2)

beginDolly(u, v)

Begin a dolly at at the given u and v.
 m.beginDolly(.1, .2)

pan(u, v)

Pan the view by the given x and y.
 m.pan(.1, .2)

panTo(u, v, scale=1.0)

Pan from the u,v given in the last call to beginPan() to the given u and v, applying a scale as well to the pan amount.
  • scale - (Keyword, Optional) Scale the operation by this amount.
 m.panTo(.1, .2)

rotateTo(u, v, scale=1.0)

Rotates the arcball to the given u and v position.
  • scale - (Keyword, Optional) Scale the operation by this amount.
 m.rotateTo(.1, .2)

transform()matrix

Gets the current transform matrix for the arcball.
 m.transform()

setTransform(matrix)

Sets the current transform matrix for the arcball. Scales in the given matrix will be ignored.
 m.setTransform(m)

identity()

Resets all values of the ArcBall to the default state.
 m.identity()

dolly(z)

Dolly the view by the given z value.
 m.dolly(.3)

dollyTo(u, v, scale=1.0)

  • scale - (Keyword, Optional) Scale the operation by this amount.
Dolly from the u,v given in the last call to beginDolly() to the given u and v, applying a scale as well to the dolly amount.
 m.dollyTo(.1, .2)

Miscellaneous

__getstate__()dict

Returns a dictionary with persistent data about the object suitable for pickling and deep copies.

__setstate__(dict)

Reads the dictionary to update persistent details about the object, suitable for unpickling and deep copies.