Hi Eric, it is very practical to have multiple instances of one object placed at various locations in your scene. For that you would have only one Node for the object but you would have one MatrixTransform for each instance of your object (each MatrixTransform would have the Node added as a child) - this saves you from loading one object to memory several times.
Marc ----- Original Message ----- From: "Eric Maslowski" <[EMAIL PROTECTED]> To: "'osg users'" <osg-users@openscenegraph.net> Sent: Friday, September 22, 2006 4:48 PM Subject: RE: [osg-users] simple question regarding transforms > Hi Robert, > Right, that's what I'm wondering. What additional functionality of > MatrixTransform is there that requires them to be a separate level in the > scenegraph and separated from the node it controls? If they are only used > for transforming nodes, and nodes almost always have a single > MatrixTransform directly above them, then why an interface like below isn't > used. > > node->setTrans(Vec3); > node->setOrientation(Quat); > node->setMatrix(Matrixf); > node->setXForm(MatrixTransform); > > Is it so that multiple nodes can share the same xform without needing to > parent each other explicitly? Currently, our environments have shown a 1 > MatrixTransform to 1 Node relationship, and I'm just making sure I > understand the full intentions of the transforms so I can explain it to > others. > > Thanks > > E. > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:osg-users- > > [EMAIL PROTECTED] On Behalf Of Robert Osfield > > Sent: Friday, September 22, 2006 10:19 > > To: osg users > > Subject: Re: [osg-users] simple question regarding transforms > > > > Hi Eric, > > > > Umm... its called OO programming, nodes can't be everything, you break up > > the classes to fit the functionality they deliver. > > > > Robert. > > > > > > On 9/22/06, Eric Maslowski <[EMAIL PROTECTED]> wrote: > > > > Thanks again, Robert. > > > > One more quick question regarding the use/purpose of > > MaxtrixTransforms. Is > > there a reason why the transforms for a node are separate from the > > Node* > > class? The reason I ask is that I'm finding myself using a > > MatrixTransform > > above many of my objects (static or otherwise), but not anywhere > > else. Are > > there other intentions or advanced uses for the MaxtrixTransform > > class which > > better demonstrate/explain the separation? > > > > Thanks again for your advice. If I have something worth sharing > > regarding > > the physics integration, I'll post it. > > > > Cheers > > > > E. > > > > --- > > Eric Maslowski > > Research Computer Specialist > > University of Michigan 3D Lab > > > > Autodesk 3D Studio Max Certified Trainer > > > > email: [EMAIL PROTECTED] > > office: 734-615-9699 > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:osg-users- > > > [EMAIL PROTECTED] On Behalf Of Robert Osfield > > > Sent: Thursday, September 21, 2006 16:57 > > > To: osg users > > > Subject: Re: [osg-users] simple question regarding transforms > > > > > > On 9/21/06, Eric Maslowski <[EMAIL PROTECTED]> wrote: > > > > > > Thanks Robert, > > > Unfortunately, I currently don't have the luxury of doing > > it at > > > construction time, but this is something I will probably > > address in > > > the near > > > future. > > > > > > Is there an easy way to query whether or not a specific node > > already > > > has a > > > MatrixTransform sitting above it? (casting the results of > > > getParent() > > > perhaps?) I would like to avoid creating duplicate > > MatrixTransforms, > > > especially for scenes that may be comprised of many rigid > > bodies. > > > > > > > > > > > > Sure, just use: > > > for(all my parents) > > > { > > > if (!getParent(i)->asTransform()) > > > { > > > need to insert a parent, but first put this in a list > > > } > > > > > > } > > > // then change the parents over to avoid invalidating parent > > > positions/iterators. > > > > > > Robert. > > > > > > _______________________________________________ > > osg-users mailing list > > osg-users@openscenegraph.net > > http://openscenegraph.net/mailman/listinfo/osg-users > > http://www.openscenegraph.org/ > > > > > > > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/