Horde3D

Next-Generation Graphics Engine
It is currently 18.04.2024, 04:54

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 28.03.2012, 19:01 
Offline

Joined: 28.03.2012, 18:45
Posts: 2
Hi all,

I'm currently trying to modify each joint of a custom rig loaded as a resource in the Horde3D engine.
The idea would be to browse each joint node, retrieves it position & orientation and modify it.
But I also have a constraint, I need to check the joint name before modify it.

Rough Example:

Code:
        //...
        H3DNode rigNode= h3dAddNodes( H3DRootNode, MyRigResource );

        std::string MyCustomJointName="..."

        //retrieves all joints
   int countNodes=h3dFindNodes( rigNode, "", H3DNodeTypes::Joint);

   for(int index=0 ; index<countNodes ; ++index)
   {
      H3DNode joint=h3dGetNodeFindResult( index );
               
                // find a way to compare the horde3D joint name with my custom joints data
                if ( h3dGetNodeParamStr(joint,MyCustomJointName) )
                  {
                float x = h3dGetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,0);
                float y = h3dGetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,1);
                float z = h3dGetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,2);

                           h3dSetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,x*2.0);
                 h3dSetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,y*2.5);
                 h3dSetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,z*1.5);
                  }
   }



Actually my main problem is that I don't know how to retrieve the position & orientation data from a joint node.

I someone has an idea, it will really be useful.

Thanks :)


Top
 Profile  
Reply with quote  
PostPosted: 28.03.2012, 21:48 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
You can't change the loaded resource data without manipulating the whole resource data and reload it into horde. Do you really want to change the resource data or it's loaded node representation. Take note that their's a difference between resources and scene nodes.


Top
 Profile  
Reply with quote  
PostPosted: 28.03.2012, 22:03 
Offline

Joined: 28.03.2012, 18:45
Posts: 2
Hi Volker,

Well, I don't really have the choice, the idea is to be able to use the kinect in real time and
change the position of the loaded rig according to the 3D positions given by the kinect 3D camera.
Therefore, I really need to modify the rig, at each frame, in real time.
If you have an idea on how I can achieve this, please do so :)

Thanks.


Top
 Profile  
Reply with quote  
PostPosted: 29.03.2012, 07:06 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
For such a use case you only need a model with joints that could be mapped to the kinect's skeleton representation. You have to load this model resource with all it's meshes and joints and add it to the scene graph. You can then manipulate the joints' transformations by using e.g. h3dSetNodeTransform. Take note that you transform the joint nodes in the scene graph and not the resourcedata itself.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group