Scrive Antonio Bleile <[EMAIL PROTECTED]>: > Hi Matthias, > > Scrive Matthias Stiller <[EMAIL PROTECTED]>: > > > Hmm, > > > > why not look into the source, should be pretty short for this file > > format ;-) > > Cause I'm lazy ;) But you're right, looking at the code > I found calls to createSharedIndex(..) and calcVertexNormals(...)
Hi, I tried to copy from the STL loader but in my case it crashes somewhere in createSharedIndex. So I took a closer look at the STL loader. Here's a snippet: beginEditCP(points); beginEditCP(norms); while (actIt != endIt) { points->addValue(Pnt3f(actIt->v1x, actIt->v1y, actIt->v1z)); points->addValue(Pnt3f(actIt->v2x, actIt->v2y, actIt->v2z)); points->addValue(Pnt3f(actIt->v3x, actIt->v3y, actIt->v3z)); norms->addValue(Vec3f(actIt->nx, actIt->ny, actIt->nz)); ++actIt; } endEditCP(norms); endEditCP(points); beginEditCP(geo); { geo->setTypes (type); geo->setLengths (lens); geo->setPositions(points); geo->setNormals (norms); } endEditCP(geo); createSharedIndex(geo); calcVertexNormals(geo); As you can see there is one normal per face. But shouldn't it be one normal per vertex? Is this code correct? If I remove the "setNormals" call my program does not crash anymore, perhaps the createSharedIndex routine trys to access the normals array outside of its boundaries... Regards, Toni ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ------------------------------------------------------------------------- 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 Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users