G'day

I'm implementing a display using the osgSim::scalarbar.  When I set
the orientation to vertical the geode disappears.

In osgSim::ScalarBar::createDrawables() the vertical rotate matrix is:

  matrix = osg::Matrix::rotate(osg::DegreesToRadians(90.0f),1.0f,0.0f,0.0f) * 
osg::Matrix::translate(_position);

which I understand to rotate around the X axis.  But the verticies are
laid out on the XY plane so shouldn't the rotation be around the Z axis?
Like this:

  matrix = osg::Matrix::rotate(osg::DegreesToRadians(90.0f),0.0f,0.0f,1.0f) * 
osg::Matrix::translate(_position);

This change fixed it for me.  Am I right or have I completely missed something 
here?



On a related note; in examples/osgscalarbar.cpp there is a curious comment:
    osg::Matrixd matrix(osg::Matrixd::scale(1000,1000,1000) * 
osg::Matrixd::translate(120,10,0));
 // I've played with these values a lot and it seems to work, but I have no 
idea why

I'm guessing the comment refers to the large values for scale, but (I think) 
thats
just because the default width for the bar is only 1.0


Cheers
Murray
Tag Systems
Melbourne
Australia


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to