The .obj plugin defaults to assuming that the models are coming in with Y up, so its doing a rotating of the coordinates inside the plugin. For most .obj models I've come across are Y up, but this is far for exclusive as you're example shows. You can get the .obj plugin to not transform the model by using the ReaderWriter option string "noRotation" i.e
osgviewer mymodel.obj -O "noRotation"
You can also pass the "noOption" string as a ReaderWriter::Option object into the readNodeFile.
Robert.
I am also used to thinking Z up worlds as that is how most Universities teach math.
You mention that the x, y, and z values are unchanged from the osg::Geometry. I am having problems with my values and I do see a switch and that negation. The only thing I do is to attach the node to an identity node and to the scene graph. Can you explain why my vertices might be transformed? I am saving a test box with MilkShape3D to an OBJ file. The obj file does not contain any transformation matrix but rather just raw vertex data is plain ascii format.
Where could the transformation be happening?
Thanks,
/jk
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Robert Osfield
Sent: Wednesday, August 30, 2006 5:57 AM
To: osg users
Subject: Re: [osg-users] Collecting vertex array... is this correct?
Hi Jeff,
On 8/30/06, Jeff Kershner <[EMAIL PROTECTED]> wrote:
I have noticed that the vertices x, y, z from a model come to the TriangleFunctor as x, z, -y. This is probably normal as OSG is Z pos up…
The TriangleFunctor will just pass along the xyz values that are in the osg::Geometry unchanged in order or sign.
The OSG's plugins generally assume z up, y north, x east, and the OSG's camera manipulator also default to home position with z up, y north, x east.
This convention is the standard in vis-sim, but not all modelling apps follow it, and some graphics apps/users are used to y up. OpenGL being one of them, the eye coordinates are y up, z out of the screen, x to the right. The OSG's camera view matrices will take you from the z up coordinate frame to the y up OpenGL one.
The way I think about things is z up works well for world coordinates, when you think about your whole scene, and real world maps etc. However, when thinking about screen coordinates its useful to think a y up and x the right as this is what we are used to when draw xy graphs.
Robert.
Now if you load a model which had y up, z out the
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
