David L. Page
2008-06-20 14:22:59 UTC
I am over writing the projection matrix as the following python code
(snippet) below illustrates.
My motivation is that I want to have some more control over the projection
matrix for a tiled display. Currently, with the first code, the projection
matrix seems to be set and rigid, despite what happens to the projection
matrix in the application. However, I need to configure the projection
matrix specific to my wall display, but I also need some flexibility for it
to adjust on the fly via the application.
===begin snippet
renderspu = SPU( 'render' )
node = CRNetworkNode( "server%d" % id, "dynamic" )
node.Conf('optimize_bucket', 0)
node.AddTile( 0, 0, view.col, view.row )
p = CRMatrix()
p.Frustum( x_left, x_right, y_bottom, y_top, z_near, z_far )
node.Conf('projection_matrix', p.ToList())
node.AddSPU( renderspu )
cr.AddNode( node )
=== end snippet
My question is what if I created a "viewspu" that did the samething.
Basically, this new spu would intercept OpenGL calls that modified the
projection matrix (i.e. glOrtho, glFrustum, glScale, glRotate, etc.) and
force the projection matrix to remain as the one specified. The new python
code would look something like the following:
===begin snippet
viewspu = SPU('view')
renderspu = SPU( 'render' )
node = CRNetworkNode( "server%d" % id, "dynamic" )
node.Conf('optimize_bucket', 0)
node.AddTile( 0, 0, view.col, view.row )
p = CRMatrix()
p.Frustum( x_left, x_right, y_bottom, y_top, z_near, z_far )
viewspu.Conf('projection_matrix', p.ToList())
node.AddSPU( viewspu)
node.AddSPU( renderspu )
cr.AddNode( node )
=== end snippet
(snippet) below illustrates.
My motivation is that I want to have some more control over the projection
matrix for a tiled display. Currently, with the first code, the projection
matrix seems to be set and rigid, despite what happens to the projection
matrix in the application. However, I need to configure the projection
matrix specific to my wall display, but I also need some flexibility for it
to adjust on the fly via the application.
===begin snippet
renderspu = SPU( 'render' )
node = CRNetworkNode( "server%d" % id, "dynamic" )
node.Conf('optimize_bucket', 0)
node.AddTile( 0, 0, view.col, view.row )
p = CRMatrix()
p.Frustum( x_left, x_right, y_bottom, y_top, z_near, z_far )
node.Conf('projection_matrix', p.ToList())
node.AddSPU( renderspu )
cr.AddNode( node )
=== end snippet
My question is what if I created a "viewspu" that did the samething.
Basically, this new spu would intercept OpenGL calls that modified the
projection matrix (i.e. glOrtho, glFrustum, glScale, glRotate, etc.) and
force the projection matrix to remain as the one specified. The new python
code would look something like the following:
===begin snippet
viewspu = SPU('view')
renderspu = SPU( 'render' )
node = CRNetworkNode( "server%d" % id, "dynamic" )
node.Conf('optimize_bucket', 0)
node.AddTile( 0, 0, view.col, view.row )
p = CRMatrix()
p.Frustum( x_left, x_right, y_bottom, y_top, z_near, z_far )
viewspu.Conf('projection_matrix', p.ToList())
node.AddSPU( viewspu)
node.AddSPU( renderspu )
cr.AddNode( node )
=== end snippet
--
David L. Page
***@ieee.org
865.607.8192
David L. Page
***@ieee.org
865.607.8192