Scrive Marcus Lindblom <[EMAIL PROTECTED]>: > Antonio Bleile wrote: > > Hi, > > > > I'm trying to implement a feature that permits the > > user to swap the normals of a selected geometry node. > > That worked ok so far, but some models, especially > > the ones imported from OBJ seem to share the > > same geometry core (correct guess?). So when I > > call a traverse on a selected geometry node, > > I end up swapping normals of geometry the user > > has not selected! How can I detect such a > > situation or how can I unshare the core? > > Do I have to do a DeepClone and substitute > > the node? But then I've to get rid of the > > unreferenced vertices.... > > > > Suggestions? > > > Hi Toni! > > You might not be sharing cores, but the geometry properties. (i.e. use > the same positions array but different index). For VRML, this sure is > the case. You can easily test this by writing out the pointer values of > both cores and geoproperties. > > I think there's something called SeparateProperties which might help you > to un-share properties. To unshare cores, you need to clone. (You can > actually do this while traversing, it's what I do in my traversor for > putting every vertex in worldspace while keeping the graph somewhat intact).
Hey Marcus, that was a good pointer! Indeed calling separateProperty(Normals,Normals) solved my problem. Obviousely the osb file size quadrupled.... :( Thnak you & best 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 [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
