Making new Ragdolls
BergBoy
09-05-2006 10:11:29
How do I make a new Ragdoll XML file using a different mesh (other than the zombie taht came with OgreNewt)? Im a little stumped on it. I tried looking at the zombies XML file but im still a little vague on it. Are there tools about? Any docs? etc
BergBoy
15-05-2006 03:44:13
come on guys. Someone here must know. I have a bipedal guy and I need to make a convex hull ragdoll on him. How do I make an XML file for him so it makes his convex hull ragdoll right...
walaber
15-05-2006 17:50:15
there are no tools... you just edit the XML file by hand for now... you can see that the heirarchy of the XML file mirrors the heirarchy of the skeleton.
jtpsoft
01-06-2006 19:57:07
So i try to write a minihowto(tell me if i'm wrong):
I create a charachter in maya(or whatelse)with his .skeleton and xml conversion...
than copy the xml just created into other xml file and add the line that will be usefull for ragdoll(the different lines between my skeleton and xml of demo08)..
then create a node with the .mesh..and add ragdoll=new ragdoll("new.xml");
this is correct??will work??
jtpsoft
01-06-2006 20:24:14
i've tried to put ragdoll.h/cpp into my project and:
------ Build started: Project: pt, Configuration: Release Win32 ------
Compiling...
Ragdoll.cpp
.\Ragdoll.cpp(189) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
.\Ragdoll.cpp(222) : error C2664: 'bool TiXmlDocument::LoadFile(TiXmlEncoding)' : cannot convert parameter 1 from 'Ogre::String' to 'TiXmlEncoding'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
MainFrameListener.cpp
MainApplication.cpp
Main.cpp
Build log was saved at "file://c:\Documents and Settings\Fabio\Desktop\pt\pt\Release\BuildLog.htm"
pt - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
why doesn't take the right overload??
walaber
01-06-2006 22:46:39
you need to define TINYXML_USE_STL.
jtpsoft
02-06-2006 00:23:35
tnx now works...i'll go to try if i can put my models on ragdoll system...
jtpsoft
02-06-2006 14:07:28
will exist in next release any doc. that explain the xml of ragdoll??i've tried to make my xml and the program crash...
<RagDoll>
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="root">
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="root2">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="dx">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="dxb">
</Bone>
</Bone>
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="sx">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="sxb">
</Bone>
</Bone>
</Bone>
</Bone>
</RagDoll>
is this right??
down here the skeleton.xml relative to above mesh
<skeleton>
<bones>
<bone id="0" name="root">
<position x="0.665089" y="9.01612" z="0.0162127"/>
<rotation angle="3.14159">
<axis x="-0.704521" y="0.709683" z="4.31381e-017"/>
</rotation>
</bone>
<bone id="1" name="root2">
<position x="4.44379" y="1.28303" z="-0.405907"/>
<rotation angle="3.14159">
<axis x="-0.704521" y="0.709683" z="4.31381e-017"/>
</rotation>
</bone>
<bone id="2" name="dx">
<position x="-2.78121" y="-1.18665" z="4.78808e-016"/>
<rotation angle="1.52453">
<axis x="0" y="0" z="-1"/>
</rotation>
</bone>
<bone id="3" name="dxb">
<position x="5.24782" y="2.43632" z="-0.861232"/>
<rotation angle="1.52453">
<axis x="0" y="0" z="1"/>
</rotation>
</bone>
<bone id="4" name="sx">
<position x="2.74413" y="-1.18665" z="-2.02767e-016"/>
<rotation angle="3.14159">
<axis x="-0.723273" y="-0.690563" z="4.22834e-017"/>
</rotation>
</bone>
<bone id="5" name="sxb">
<position x="-3.97699" y="1.79548" z="1.01815"/>
<rotation angle="1.52453">
<axis x="0" y="0" z="1"/>
</rotation>
</bone>
</bones>
<bonehierarchy>
<boneparent bone="root2" parent="root"/>
<boneparent bone="dx" parent="root2"/>
<boneparent bone="dxb" parent="dx"/>
<boneparent bone="sx" parent="root2"/>
<boneparent bone="sxb" parent="sx"/>
</bonehierarchy>
</skeleton>
walaber
02-06-2006 19:14:41
you are missing joints for the last bones... try this:
<RagDoll>
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="root">
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="root2">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="dx">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="dxb">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
</Bone>
</Bone>
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="sx">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
<Bone dir="0 1 0" length="0.0" shape="hull" size="0.3 0.0 0.0" mass="20.0" skeleton_bone="sxb">
<Joint type="ballsocket" pin="0 1 0" limit1="20.0" limit2="10.0" />
</Bone>
</Bone>
</Bone>
</Bone>
</RagDoll>
jtpsoft
03-06-2006 19:11:49
no,don.'t works...it crash the program and the debug tell me that it crash here:
m_col = NewtonCreateConvexHull( m_world->getNewtonWorld(), vertcount, (float*)&verts[0].x, sizeof(Ogre::Vector3), &matrix[0]);
do you know what's happen??
jtpsoft
03-06-2006 20:17:14
i've tried with primitives instead hull and works...there's something particular to do in the mesh fr convexhull??
walaber
04-06-2006 02:16:01
yes. you MUST have some vertices assigned to the EXACT bone that you use in the XML file. if you assign a bone that has no vertices, it will try to create a convex hull with zero points, and crash.
maybe your "root" bone isn't actually mapped to any verts in the model?
jtpsoft
04-06-2006 14:57:25
Tnx i finally have convex hull!!!
P.s. why when i assign a convex hull(without ragdoll) to entire zombie mesh the LOOP animation doesn't work??
SFAOK
15-06-2006 09:29:01
I'm also trying to create a ragdoll for a spider model I have. I've removed all the bones appart from five that make up a single leg on the creature, and tried creating the corresponding spider_rag_hull file.
I have two questions:
1. How would I translate the hierachy of the ragdoll xml file to correspond with the skeletal one? I put the bones in the same order, but I'm a bit confused about when to terminate (i.e </Bone>) for each bone.
2. When I create the spider (with the skeleton running though one of the mesh's legs), the bones quickly break up and go into what I can only describe as a slow drifting orbit (like they are not connected at all). Why is this? Does it have something to do with the layout of the </Bone> parts in the ragdoll xml file?
The thing is, I created a simple 4 segment snake type thing in 3DS Max with the corresponding 4 bones, and the first time I did it I got the same problem - the snake would strike the ground and then looking in debug mode the bones would break appart. I created a new snake from scratch, and it worked perfectly! I've tried breaking it again, but I haven't managed it - the worst I can do is truncate the hull so that later links in the chain aren't created. Maybe this indicates that the problem with the hull breaking up lies in the 3DS Max creation?
walaber
15-06-2006 21:57:12
the problem is most likely in your XML file. the way it works is that <Bone> elements inside other elements are children of that bone. so for a 4-element snake, it would look like this
<Bone name="link1">
<Bone name="link2">
<Bone name="link3">
<Bone name="link4">
</Bone>
</Bone>
</Bone>
</Bone>
SFAOK
19-06-2006 15:57:23
Thanks for that. I mirrored the hierachy of the creature and now the hull doesn't break appart!
I have another problem though - The model I'm trying to create a ragdoll for can be seen below:
As you can see, there is quite a lot of internal skeletal structure (so that all eight legs plus the abdomen, thorax and other bones can be connected to the root bone underneath). These internal bones (blue) do not have any influence on mesh deformation, they are there for other simulation needs.
However, this poses a problem when creating a ragdoll hull because I get hull sections WITHIN others, which makes the ragdoll spin and fly around like its got rockets attached...
Does anyone have any idea how I could setup a ragdoll for this creature? I only want to model the legs plus one hull section for the body to be honest, but I can't figure out how to do this without removing the internal bones. Is there a way of switching off inter-ragdoll collisions or something?
Ravine
09-01-2007 02:38:38
I keep getting the error: ERROR! cannot find 'root'
For my ragdoll xml file I just changed the bone names to ones in the mesh I am using. It doesn't crash, just shows the error in the console.
Anyone else getting this error?
EDIT: Problem fixed; I did not have the right path to the xml file.