[osg-users] second newbie question reiteratedwithdrawLin (UNCLASSIFIED)

Konkle, Daniel T AMRDEC/Dynetics Daniel.Konkle at us.army.mil
Fri Mar 13 07:49:40 PDT 2009


Classification:  UNCLASSIFIED 
Caveats: NONE

I appreciate all the help.
Turns out the problem was related to lighting.
disabling it draws the colors correctly for that camera.

thanks to all!

> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-
> bounces at lists.openscenegraph.org] On Behalf Of Ulrich Hertlein
> Sent: Thursday, March 12, 2009 8:52 PM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] second newbie question reiteratedwithdrawLin
> (UNCLASSIFIED)
> 
> Hi Daniel,
> 
> On 13/3/09 3:34 AM, Konkle, Daniel T AMRDEC/Dynetics wrote:
> > The strange thing is that the first triangle that I draw is the
wrong
> > color and the second triangle is the correct color and they are both
> > drawn from the same geode.
> >...
> >>       osg::Vec3Array* tri = new osg::Vec3Array;
> >>       tri->push_back(osg::Vec3(0.0f, -0.1f, depth));
> >>      tri->push_back(osg::Vec3(0.1f, 0.0f, depth));
> >>      tri->push_back(osg::Vec3(0.0f, 0.1f, depth));
> >>...
> >>         osg::Matrix rot_mat = osg::Matrix::rotate( M_PI, 0.0f,
0.0f,
> 1.0f);
> >>         rotate->setMatrix( rot_mat );
> >>...
> >>      // set the normal in the same way color.
> >>      osg::Vec3Array* normals = new osg::Vec3Array;
> >>      normals->push_back(osg::Vec3(0.0f,-1.0f,0.0f));
> >>      linesGeom->setNormalArray(normals);
> >>      linesGeom->setNormalBinding(osg::Geometry::BIND_OVERALL);
> 
> Could it be your normal is wrong?
> Your object is constructed in the X/Y plane but has a normal of
> osg::Vec3(0,-1,0) i.e. -Y.
> Try it with a +Z normal i.e. osg::Vec(0,0,1).
> 
> Hope this helps,
> /ulrich
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
Classification:  UNCLASSIFIED 
Caveats: NONE




More information about the osg-users mailing list