Hi Francesco,

I could reproduce the crash. As a workaround load the file via

NodePtr model = osg::SceneFileHandler::the().read(MODEL, NULL);

this loads the file without the default optimizer. Looks like the tri 
stripper creates a wrong index.

Andreas

> Andreas Zieringer ha scritto:
>> Hi Francesco,
>>
>> just tried it with a current OpenSG version and it worked fine. I 
>> think I fixed some time ago a bug in calcVertexTangents() what version 
>> are you using.
>>
>> Andreas
>>
>>   
> I just upgraded to a CVS version compiled yesterday... it still crashes! 
> maybe it's an error in my code...
> 
> In attachment there is a sample program i wrote to test 
> calcVertexTangents() functionality... and it crashes to me with 
> dinosauro.3DS. What's wrong ?
> 
> thank you very much for your time ;)
> 
> Francesco Tamagni
> 
> 
> ------------------------------------------------------------------------
> 
> 
> #include <OpenSG/OSGSceneFileHandler.h>
> #include <OpenSG/OSGGeoFunctions.h>
> #include <OpenSG/OSGNode.h>
> 
> 
> 
> // Activate the OpenSG namespace
> OSG_USING_NAMESPACE
> 
> #define MODEL "C:/Documents and Settings/tamagni/Documenti/dinosauro.3DS"
> 
> int main(int argc, char **argv)
> {
>     
>     // OSG init
>     osgInit(argc,argv);
> 
>       printf("loading model...\n");
>       NodePtr model = osg::SceneFileHandler::the().read(MODEL);
>       printf("done.\n\n");
> 
>       if (model != NullFC){
> 
>               // i know that the problematic model has ony one level of 
> children
>               for (int i = 0; i< model->getNChildren(); i++) {
>                       NodePtr child = model->getChild(i);
> 
>                       if(child->getCore()->getType().isDerivedFrom( 
> Geometry::getClassType())) {
>                               
>                               GeometryPtr geo = 
> GeometryPtr::dcast(child->getCore());
>                               printf("calculating TBN...\n");
> 
>                               calcVertexTangents(geo, 0, 
> Geometry::TexCoords1FieldId, Geometry::TexCoords2FieldId);
> 
>                               printf("...DONE!\n");
>                       }
>               }
>       }
> }
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to