Skip to content
Häfner edited this page Mar 30, 2015 · 7 revisions

Virtual objects in 3D Space have a transformation, position and orientation, in space. Most scenegraph objects inherit from 'Transform'.

Different ways to define the transformation:

  1. OpenGL Matrix

    setMatrix( [a,d,g,x, b,e,h,y, c,f,j,z, u,v,w,n] )

  2. From, dir, up

  • setFrom( [x,y,z] )
    • set the position
  • setDir( [x,y,z] )
    • set the direction
  • setUp( [x,y,z] )
    • set the up direction
  1. From, at, up
  • setAt( [x,y,z] )
    • set the point in space where the object looks at

Using setDir()/setAt() switches the internal state of the transform to dir/at. This changes the behaviour of the transform when changing the position. When in dir mode, the orientation does not change when changing the position. When in at mode, the orientation changes to allways look at the at point in space.

Clone this wiki locally