Horde3D
http://horde3d.org/forums/

manipulate the transformations manually
http://horde3d.org/forums/viewtopic.php?f=2&t=319
Page 1 of 1

Author:  spaceGoof [ 30.04.2008, 13:40 ]
Post subject:  manipulate the transformations manually

Hi folks.
I'm trying to implement basic IK into horde 3D.

I want to animate a basic kinematic chain ( skinned tentacle made of six bones designed in blender and imported using collada converter)

To do so, I thought the most straightforward fashion would be to directly manipulate the Kinematic chain's joints using the setModelAnimParams() function.

Althouh I have access to joints (findNodes()), applying manual transformation on tentacles' chilren joints (Bone_00X) does not change the tentacle configuration. Is there something I hve missed ?

heres is the code :

printf("%i\n",Horde3D::findNodes(RootNode,"Bone_004", SceneNodeTypes::Joint));
tentacleFirstBone = Horde3D::getNodeFindResult(0);

Horde3D::getNodeTransform(tentacleFirstBone,&tx,&ty,&tz,&rx,&ry,&rz,&foo,&foo,&foo);
Horde3D::setNodeTransform(tentacleFirstBone,tx,ty,tz,rx-0.1f,ry,rz,foo,foo,foo);

Many thanks.

Author:  AcidFaucet [ 30.04.2008, 16:50 ]
Post subject:  Re: manipulate the transformations manually

-0.1f of 360.0f degrees isn't going to do much.

Are you only setting the position once or is it looping?

Author:  spaceGoof [ 30.04.2008, 17:58 ]
Post subject:  Re: manipulate the transformations manually

Hi AcidFaucet.

>Horde3D::getNodeTransform(tentacleFirstBone,&tx,&ty,&tz,&rx,&ry,&rz,&foo,&foo,&foo);
>Horde3D::setNodeTransform(tentacleFirstBone,tx,ty,tz,rx-0.1f,ry,rz,foo,foo,foo);

The piece of code is embedded in the maiLoop loop.
So, yes, it is looping.
As a consequence, Bone_004 should bend.
But nothing happens.

Author:  Volker [ 30.04.2008, 19:52 ]
Post subject:  Re: manipulate the transformations manually

I guess you made sure the tentacleFirstBone is a valid NodeHandle? Have you tried any other joint?

Maybe you can load the model into the editor and check the joint hierarchy.

Author:  spaceGoof [ 01.05.2008, 09:02 ]
Post subject:  Re: manipulate the transformations manually

Hi Volker.

For instance, Bone_004 had index n° 7 (So I guess it is a valid NodeHandle). If there is another way to check, please tell me.

The models looks OK in Blender, hierarchy is valid both in blender and Horde xml format. You will find the tentacle.scene file.

The first node of the model (Bone) (which is the tentacles' root joint) do actually modify the orientation of the whole tentacle. Subsequent joints have no influence on the tentacle mesh.

/************************************************************************************************************************************************************
<Model name="tentacle" geometry="tentacle.geo">
<Joint name="Bone" tx="-0.01265" ty="0.00212" tz="0.05203" rx="89.2457" ry="0" rz="0.0108862" sx="1" sy="1" sz="0.999997" jointIndex="1">
<Joint name="Bone_001" tx="0" ty="0" tz="-1" jointIndex="2">
<Joint name="Bone_002" tx="0" ty="0" tz="-0.92662" jointIndex="3">
<Joint name="Bone_003" tx="-0.01041" ty="0" tz="-1.031" jointIndex="4">
<Joint name="Bone_004" tx="0.03124" ty="0" tz="-0.79148" jointIndex="5">
<Joint name="Bone_005" tx="-0.01041" ty="0" tz="-0.90603" jointIndex="6">
<Joint name="Bone_006" tx="0.02083" ty="0" tz="-0.66651" jointIndex="7" />
</Joint>
</Joint>
</Joint>
</Joint>
</Joint>
<Mesh name="Cube" material="tentacle/tentacle_Cube_tga.material.xml" tx="0.01476" ty="0.01334" tz="-1.03475" rx="0.736269" ry="0.0131791" rz="0.164452" sx="1" sy="0.999997" sz="1" batchStart="0" batchCount="3648" vertRStart="0" vertREnd="2431" />
</Joint>

</Model>
********************************************************************************************************************************************************/

Author:  Volker [ 01.05.2008, 09:13 ]
Post subject:  Re: manipulate the transformations manually

How did you convert the model from blender to Horde3D? I thought the collada exporter of blender does not support skeletal animations correctly? Did you have any warnings during the conversion? Maybe that will cause problems with the association between joints and meshes. Are you able to export the model from 3Dmax?

Author:  spaceGoof [ 01.05.2008, 10:48 ]
Post subject:  Re: manipulate the transformations manually

>I thought the collada exporter of blender does not support skeletal animations correctly?
Well, that's indeed true regarding recorded animation, I this precise case, I just need the skeletal structure. and export seema all right (no warning)
(And, the tentacle.scene description included looks good isn't it).
>Did you have any warnings during the conversion?
no, everything was fine
>Are you able to export the model from 3Dmax?
I dit it using maya, same result

Author:  AcidFaucet [ 01.05.2008, 16:45 ]
Post subject:  Re: manipulate the transformations manually

Is there a means to find out if vertices are weighted against the bone? It's starting to sound like they're not skinned.

Author:  Volker [ 01.05.2008, 16:46 ]
Post subject:  Re: manipulate the transformations manually

You are using the skinning.shader.xml right? Not the standard shader.

Author:  spaceGoof [ 01.05.2008, 16:52 ]
Post subject:  Re: manipulate the transformations manually

skinning.shader.xml is the one used to render the tentacle node.

Is there a way to check if weights are correctly taken into account ?

Author:  spaceGoof [ 01.05.2008, 17:03 ]
Post subject:  Re: manipulate the transformations manually

Or is there a way to display the bones/joints into Horde ?

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/