[osg-users] Get current Billboard ModelView matrix?

Julien Valentin julienvalentin51 at gmail.com
Thu Jun 30 03:00:10 PDT 2016


Hi mille
ok I understand better why rtt doesn't fit your use.
As Robert says before you should read back the modelview accumulated by the cull pass ..
so 2 solutions:
-either you'll have to override traverse() method on all nodes
-either you'll have setup your own CullVisitor managing your scenegraph



mille25 wrote:
> Hi,
> 
> that was my first idea as well, however, then I realized that this approach does not work.
> 
> The problem is that there is no way to know if a certain pixel still shows the same fragment. For example, if the camera view angle changes by 180 degrees in one frame, the pixel at the 0,0 texture coordinate would no longer refer to the same fragment. Therefore, the program would compute the delta between two unrelated fragments, yielding a wrong result.
> 
> However, with my approach, the program would calculate the old fragment position by using the old view matrix (pre 180 degree change) and the model matrix (unchanged in this example), compute the distance to the camera and compare it to the old distance, resulting in 0. 
> 
> Or another example: Imagine the camera looking at the ground (perfectly planar surface) at a 45 degree angle and moving forward every frame. If I only compared the pixel values of the output texture, every point on the ground would yield a 0 delta distance, because the new fragment is just as close to the camera as the old fragment. However, with my approach, each fragment would show a negative delta distance, because they moved towards the camera.
> 
> Thank you!
> 
> Cheers,
> Philipp


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67930#67930








More information about the osg-users mailing list