It's me again :) I did some more research as to what causes the projection matrix to get destroyed.
I replaced my hud with the complete createHud() from osghud example (multiple
textlines with a transparent gray quad as backgroung) to see if my hud was at
fault. With that, it worked, the error did not occur. Then I removed the
background quad leaving only the text and boom! there it was again.
Then I readded the quad but removed the z-offset (float depth =
bb.zMin()-0.1;) and set the depth to 0. Same problem!
So my -humble- conclusion is: osg doesn't like cameras whose subgraph is
completely flat (i.e. has a z-depth of 0). The strange thing is, that the hud
continues to display fine, but the projection matrix of its parent camera is
affected if it has nothing else to display because the model left the field
of view.
I've uncommented the osg::notifies in _clampProjectionMatrix in
CullVisitor.cpp and got the following output sequence as soon as my model
left the fov:
Persepective matrix before clamping{
1.29903806696231 0 0 0
0 1.73205080756888 0 0
0 0 -1.00098087302356 -1
0 0 -0.00570442971828006 0
}
Persepective matrix after clamping{
1.29903806696231 0 nan 0
0 1.73205080756888 nan 0
0 0 nan -1
0 0 nan 0
}
Persepective matrix before clamping{
1.29903806696231 0 0 0
0 1.73205080756888 0 0
0 0 -1.00098087302356 -1
0 0 -0.00570442971828006 0
}
Persepective matrix after clamping{
1.29903806696231 0 nan 0
0 1.73205080756888 nan 0
0 0 nan -1
0 0 nan 0
}
Persepective matrix before clamping{
1.29903806696231 0 nan 0
0 1.73205080756888 nan 0
0 0 nan -1
0 0 nan 0
}
Persepective matrix after clamping{
nan nan nan nan
nan nan nan nan
nan nan nan nan
nan nan nan nan
}
Perhaps a division by zero happens somewhere in there ?
__
Rud
pgpVLLpgNzGYj.pgp
Description: PGP signature
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
