[osg-users] PositionAndAttitudeTrabsform

2010-01-01 Thread amit ben-david
Hi,

beginner question : 

i just used the PositionAndAttitudeTransform with 
setScale(0.1, 0.1, 0.1)
to scale down an object in my scene graph.

the object indeed scaled down but the light behaviour changed totaly from blue 
to white, like in specular highlights. 
for a different object it just colored everything differently.

to my understanding scaling an object should not change normals or colors, and 
therefore the coloring should stay the same and not change that drastically.

what am i missing ? 

Thank you!

Cheers,
amit

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PositionAndAttitudeTrabsform

2010-01-01 Thread Simon Hammett
2010/1/1 Gordon Tomlinson gor...@gordon-tomlinson.com

 Your right it does not scale the normals. So the normal are no longer
 correct for the model once you scale it

 See http://www.vis-sim.com/osg/osg_faq_1.htm#f19


That should really mention that rescale only works with uniform scaling.

-- 
http://www.ssTk.co.uk
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PositionAndAttitudeTrabsform

2010-01-01 Thread Paul Martz
PositionAttitudeTransform, like any OSG Transform, sets the OpenGL 
ModelView matrix, and that matrix is used to transform the normals (see 
the OpenGL spec, or any OpenGL book). So, scaling an object does indeed 
scale the normals.


GL_RESCALE_NORMAL works only for uniform scaling, as noted in Simon's 
post. For non-uniform scaling, use GL_NORMALIZE.


If you're using shaders (and I don't think you are, but if you do in the 
future), a third option would be to transform your normals directly in 
the shader code, giving you total control over how they are transformed.


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PositionAndAttitudeTrabsform

2010-01-01 Thread amit ben-david
Hi,

Right on the button, 

Thank you very much  
amit

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org