Build some invisible mesh on the models hand, and then make a node visitor
that replaces that mesh with your attachment, and possibly a switch node.
 

Zach


 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of bertrand greslier
Sent: Tuesday, November 28, 2006 17:59
To: osg users
Subject: Re: [osg-users] Cal3d and OSG


Hi,

First time, If you want get a bounding box of a hand, a feet (variable
pied)... in the cal3d api 
perhaps this code can help you :

osgCal::CoreModel * temp = const_cast<osgCal::CoreModel
*>(GetModel()->getCoreModel()); 
CalCoreModel * core = temp->get();
CalCoreSkeleton *skel= core->getCoreSkeleton();
    
std::vector< CalCoreBone * > & listBone= skel->getVectorCoreBone ();
    
for (GLuint i=0; i< listBone.size();i++) {
    cout<<"nom bone="<<listBone[i]->getName()<<endl;
}   

CalCoreBone * pied= skel->getCoreBone ("Cally R Foot");
    
pied->calculateBoundingBox(core); 
    
CalBoundingBox & boxPied = pied->getBoundingBox();

cout<<"boxPied.plane[0].a="<<boxPied.plane[0].a<<endl;

CalVector points[8];
boxPied.computePoints(points); 
for (GLuint i =0; i<8 ;i++) cout<<"x,y,z
="<<points[i].x<<","<<points[i].y<<","<<points[i].z<<endl;

Second time, you can make a osg call back class to update the position of
your model .ive 

regards,
Bertrand.



On 11/27/06, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote: 

Hey guys. How goes it? 

I have a little question regarding Cal3d and OSG. I am using Cal3d inside
OSG with OSGCal from sourceforge. I would like to attach an item to a Cal3d
Model's hand and forget about it rather than having to update it manually.
The item would probably be a .ive file. Is there a way to attach this so
that it moves along with the hand? I believe that the Cal3d Model is a set
of drawables drawn onto a geode. If you've dealt with this before or have
any good ideas I would appreciate it greatly. Thanks all!! 

John 


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/






-- 
Bertrand Greslier
http://www.cooki3d.org 
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to