Chromium: 'projection_matrix' on server node as in 'cavetest1.conf'. Do I need to write a 'scaling' SPU?
"David L. Page" <[email protected]> Wed, 11 Jun 2008 11:08:18 -0400
| Newsgroups | gmane.comp.graphics.chromium.user |
|---|---|
| Message-ID | <[email protected]> |
--===============0458976117==
Content-Type: multipart/alternative;
boundary="----=_Part_12288_23495567.1213196898797"
------=_Part_12288_23495567.1213196898797
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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
[email protected]
865.607.8192
------=_Part_12288_23495567.1213196898797
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<div> </div>
<div>CR users--</div>
<div> </div>
<div>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:</div>
<div> </div>
<div>---- begin snippet ---</div>
<div> </div>
<div>renderspu = SPU( 'render' )<br>node = CRNetworkNode( )<br></div>
<div>p = CRMatrix()<br>p.Frustum( -fScale, fScale, -fScale, fScale, fScale, farPlane )</div>
<div>node.Conf('projection_matrix', p.ToList())<br clear="all"><br> node.AddSPU( renderspu )<br> cr.AddNode( node )</div>
<div> </div>
<div>--- end snippet----<br></div>
<div>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?</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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. </div>
<div> </div>
<div>I am thinking this 'scale' SPU would sit in front of a 'render' SPU on a crserver node. Any thoughts on this approach?</div>
<div> </div>
<div>I would appreciate any comments or feedback or tips/tricks. Thanks in advance.</div>
<div> </div>
<div>--Dave</div>
<div> </div>
<div> </div>
<div>-- <br>David L. Page</div>
<div>Knoxville, Tennessee<br><a href="mailto:[email protected]">[email protected]</a><br>865.607.8192<br></div>
------=_Part_12288_23495567.1213196898797--
--===============0458976117==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
--===============0458976117==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Chromium-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chromium-users
--===============0458976117==--