On 9/14/2011 10:11 AM, Martin Haffner wrote:
Hi,
I have a .obj file which describes a car. I load this .obj with
osgDB::readNodeFile("myFile.obj"), do some operations and finally write the root node
with osgDB::writeNodeFile("output.flt").
Now I noticed that the .obj Y and Z coordinates are swapped in the .flt file.
Is there a way to prevent this swapping? Where does this swapping occur? During
loading or saving?
Another question: Both readNodeFile() and writeNodeFile() have an optional
options argument. Is there a documentation which options are available for .obj
and .flt reader/writer?
> osgconv --format obj
Plugin osgPlugins-2.8.5/osgdb_obj.dll
{
ReaderWriter : Wavefront OBJ Reader
{
extensions : .obj Alias Wavefront OBJ format
options : AMBIENT=<unit> Set texture unit for ambient
texture
options : BUMP=<unit> Set texture unit for bumpmap
texture
options : DIFFUSE=<unit> Set texture unit for diffuse
texture
options : DISPLACEMENT=<unit> Set texture unit for
displacement texture
options : OPACITY=<unit> Set texture unit for
opacity/dissolve texture
options : REFLECTION=<unit> Set texture unit for
reflection texture
options : SPECULAR=<unit> Set texture unit for specular
texture
options : SPECULAR_EXPONENT=<unit> Set texture unit for specular
exponent texture
options : noRotation Do not do the default rotate
about X axis
options : noTesselateLargePolygons Do not do the default
tesselation of large polygons
options : noTriStripPolygons Do not do the default tri
stripping of polygons
}
}
Apparently you should put "noRotation" in the option string when you load the
.obj file. (I'm not sure why doing the rotation is the default behavior; it
seems odd to me that the plugin loader is making assumptions about the
orientation of the application's world coordinate system.)
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org