|
From: David L. P. <pa...@gm...> - 2008-06-11 15:08:22
|
CR users--
I am using the 'cavetest1.conf' (with some modifications). I am particularly
interested in the code that sets the projection matrix for each wall. Here's
a snippet from the python script:
---- begin snippet ---
renderspu = SPU( 'render' )
node = CRNetworkNode( )
p = CRMatrix()
p.Frustum( -fScale, fScale, -fScale, fScale, fScale, farPlane )
node.Conf('projection_matrix', p.ToList())
node.AddSPU( renderspu )
cr.AddNode( node )
--- end snippet----
If the original OpenGL app defines a view frustrum (glFrustrum or
gluPerspective), the python script redefines that view frustrum per wall of
the cave. Right?
If so, one thing that I am struggling with is to estimate an appropriate
'fScale' and 'farPlane' on the fly. Or some other variables to appropriately
define the view frustrum to closely follow the original frustrum of the
OpenGL app.
It seems that most of the example Chromium python scripts require some a
priori knowledge about the original OpenGL app to appropriately scale the
view frustrums.
My interest is to try and do this on the fly. Does any one have any tricks
or tips to do so? The cave system that I am working with requires a certain
projection matrix/view frustrum for things to look correct. At the same
time, there is some slack for me to scale and match the the original view
frustrum of the original OpenGL app as the designer intended. I am
uncomfortable with hard coding these scale parameters in a python script
that are specific for each application.
Alternatively, one approach that I am considering is to write a 'scaling'
SPU. I haven't fully thought this approach out, but it seems I would need to
intercept glFrustrum calls. I would pass view frusturm information about my
cave to the SPU at initialization. Then, when the SPU intercepts glFrustrum
calls, it would look at the original Frustrum parameters and tweak relative
to the desired frustrum paramters for my cave.
I am thinking this 'scale' SPU would sit in front of a 'render' SPU on a
crserver node. Any thoughts on this approach?
I would appreciate any comments or feedback or tips/tricks. Thanks in
advance.
--Dave
--
David L. Page
Knoxville, Tennessee
dav...@ie...
865.607.8192
|