OpenGLContext.viewplatform
index
p:\openglcontext\viewplatform.py

Basic "mobile camera" implementation including logo-like movement methods

 
Modules
            
OpenGLContext.quaternion

 
Classes
            
ViewPlatform

 
class ViewPlatform
      A mobile "viewing platform" which can be used to set up the projection and model view matrices
 
  
__init__(self, position=(0, 0, 10), orientation=(0, 1, 0, 0), fieldOfView=1.0471975511965976, aspect=1.0, near=0.01, far=1000)
forward(self, distance=0.25)
### LOGO-like commands...
getNearFar(self)
Return the (near,far) frustum depths
moveRelative(self, x=0.0, y=0.0, z=0.0)
render(self, mode=None)
setFrustum(self, fieldOfView=1.5707963267948966, aspect=1, near=0.01, far=1000)
setOrientation(self, (x, y, z, r))
setPosition(self, (x, y, z))
setViewport(self, x, y)
straighten(self)
Re-orient so the horizon is "level"
turn(self, deltaOrientation=(0, 1, 0, 0.78539816339744828))
 Apply rotation within the current orientation,
so that 1,0,0,angle will rotate the head up,
while 0,1,0, angle will rotate the head sideways

 
Data
             RADTODEG = 57.295779513082323
__file__ = r'p:\OpenGLContext\viewplatform.py'
__name__ = 'OpenGLContext.viewplatform'