rotate.makeRotate(terrainNormal, osg::Vec3f(0,0,1)); - gives the solution to "What rotation need I apply to the terrain normal to make it parrallel to vertical?" Vertical being the implied normal of the tank-model. rotate.makeRotate(osg::Vec3f(0,0,1), terrainNormal); - is the line that gives the solution to "What rotation need I apply to the vertical to make it parallel to the terrain normal." The two vectors need to be reversed from the original code.
So you've solved the problem, then? To all the other newbies: I hear the snorts of derision in the background. "It's only a detail." "Rookie." "Newbie." "Everyone knows that." Just ignore them, and keep plugging away. If "they" are so smart then why didn't anyone else point out the disconnect between conception and execution? Oh I get it now, "they" intentionally leave those kinds of tiny problems lying around. What else can the newbies tackle with any hope of success to boost their self-confidence? Very clever. Ha! In fact, these types of preconcatenate versus postconcatenate problems plague even experienced 3D programmers, but with experience you learn to recognize more quickly that it might be the source of the problem. I (for one) rarely code such things correctly the first time. Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com <http://www.skew-matrix.com/> 303 859 9466
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
