Hi.

I had some problems with the OBJ loader and found a problem in OpenSG
when using the loaded geometry in combination with a TriangleIterator.
In my case the problem was related to texture coordinates, but the same
should hold for normals.

The Triangle/PrimitiveIterator assumes that _geo->getTexCoords() returns
NullFC if the geometry contains no texture coordinates. Yet, the OBJ
loader assigns a GeoTexCoords2f with 0 entries if the file contains no
texture coordinates. Is it possible to fix this problem? It's not urgent
but I think the modification is really minor and simple (e.g. in NodePtr
OBJSceneFileType::read(...) use

if ( texCoordPtr->size() > 0 )
  geoPtr->setTexCoords ( texCoordPtr );
else
  geoPtr->setTexCoords ( NullFC );
if ( normalPtr->size() > 0 )
  geoPtr->setNormals   ( normalPtr );
else
  geoPtr->setNormals   ( NullFC );

instead of 

geoPtr->setTexCoords ( texCoordPtr );
geoPtr->setNormals   ( normalPtr );

or something in this direction).

Thanks a lot in advance.

Jan

************************************
* Jan Meseth                       *
* Computer Graphics Group          *
* Institute of Computer Science II *
* University of Bonn               *
************************************



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to