Help Please, Skinning Mesh with Havok(animation)

Help Please, Skinning Mesh with Havok(animation)

michael guerra's picture

Hi All,

sorry for the inconvenience...

Im Having a trouble deciding how i will skin my character, I'm Using as modeler 3d max 11 and rendering with directx 9, I have integrated havok on my code, so i have ready the character ragdoll, i want that havok update my skin, so I dont know if i have to load it from *.x or convert from *.hkx, *.hkt to custom mesh, here is the problem, i saw the directx's example that the animations its loaded from the same *.x file, I want that havok load and update skin from *.hkx or *.hkt, maybe loading skin from *.x and updating the skin from *.hkx animations..

ok, so thank you very much ...

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
havokTyler's picture
This is a tricky question. Commonly what's done is users use .x or some other format to export their graphics mesh (containing vertex buffers and all that goodness), and then export the rig and animation data through an hkx. You can reference many of the animation demos (eg. Demo/Demos/Animation/Api/Blending/Normal/NormalBlendingDemo) for an example of how to load and use an hkx animation. However, Havok does not provide a commercial skinning solution. For demo purposes there is a simple, internal graphics framework that's used to apply skinning to the graphics mesh (AnimationUtils::skinMesh), but this is not suitable for end users. Basically you need to skin the mesh yourself using the skeleton pose (bone transforms) and skinBindings. Alternatively you might want to look around and see if there's some Ogre integration that shows using Havok animations to skin meshes, or you could just fall back on using DirectX which has a (deprecated, IIRC) high-level API for loading and playing animations from .x files. -Tyler
michael guerra's picture

hey tyler, thank you,

recently I'm using OGRE as you said, but Im having problems respecting to OGRE and Havok Scale,
when I export the havok RB I call the Transform Scene Filter and set Inches to meters, soI Export the same geometry to OGRE .mesh, when Iload the objects on havok and OGRE, I can see on Visual Debugger and the OGRE geometry dont match, this include Scale and Rotation, (I think that OGRE is seted to work as Up axis of camera the Y axis), so this is my start problem.

So Can you Help me,

Thanks, GodBlesses you!!

Attachments: 

AttachmentSize
Download Image.png150.18 KB
havok_josh's picture

Michael-
I can provide some general information regarding Havok scene orientation and adjustment. I have included some information regarding Ogre3d.

Getting scene orientation to match:

Havok VDB

You can adjust the scene view orientation in the VDB by going to "View > Axis". From your snapshot I can see it is orienting "Z up" which is the default orientation in 3ds Max. Your scene view in Ogre3d is probably defined by a camera, so adjusting your Havok VDB view to match the Ogre orientation is probably best. If your Y is up, you can select "View > Axis > Y up" in the VDB.

Ogre3d

There are a variety of exporters available for Ogre so I am not sure how broadly useful this advice is, but OgreMax (a freely available exporter) allows you to adjust the "Up axis" of the scene in its "Global Settings".

Getting scene scale to match:

If you have exported the scene to an Ogre .mesh file and the physics information to a Havok .hkt file, you must make the scales of each file match up. The export settings used in the Havok Content Tools will not automatically adjust the 3ds file or the Ogre exports.

By default, 3ds Max is in inches but Havok uses meters, so we use the "Transform Scene" filters to select "SCALE_INCHES_TO_METERS". In OgreMax, an Ogre3D exporter, you can set the export unit for the scene to be "Meters" in "Global Settings". It is likely most other Ogre3d exporters will have some way to set the export unit.

You can also try looking at the Ogre3d forums: http://www.ogre3d.org/forums/

I hope this information helps. Good luck!

-Josh

Josh Developer Support Engineer Havok www.havok.com
michael guerra's picture

hi,

Josh thank you so much for your help.

Now with these help I was advance a little more, I was setting up the Up axis and all its ok,

but this generated a unexpected error, I make my ragdoll and their skin ( skin exported to OGRE mesh),

when I load all, Ragdoll and Animations(Havok) and Skin(OGRE) its fine but when I set the pose transform

to OGRE from havok but this doesn't match (only 3 bones of left legmatch perfect), I record a little video (compressed with Winrar)showing this errors,so I hope that

someone an help me

thanks, God Blesses You !.

Attachments: 

AttachmentSize
Download PVideo.rar9.48 MB
havok_josh's picture

Hey michaelguerra- Sorry for the delay. We've been busy. I wanted to know if you had made any progress with this? Let me know. -Josh

Josh Developer Support Engineer Havok www.havok.com
michael guerra's picture

hey Josh thanks,

sorry, but I haven't made any progress from these day because I'm busy too, but I'm free now and I would know if you or somebody can helpme with my last post...

thanks and I will be waiting... because im beginning in the skin mesh, for me this is the hard part of my game development...

havok_josh's picture
Hey michaelguerra- I examined your video. The preview tool shows correct mapping between Havok skeleton and Havok ragdoll and correct skinning between Havok skin and Havok skeleton. The problem appears to be in the mapping between the Ogre mesh and your Havok skeleton. From the looks of it, your bone ordering is wrong. I don't know how your Ogre exporter is working so I can only guess but I would suggest looking at the Ogre bone ordering (for example, the left leg femur is at index X for Havok but at index Y for Ogre). If you are using an Ogre mesh the triangles must be skinned to a bone hierarchy matching the Havok bone hierarchy. In addition, you should check the coordinates used for the Havok exporter vs Ogre exporter (meaning, is Havok Y the same as Ogre exporter Y?). This doesn't seem to be strictly a Havok problem so I would also recommend looking around on the Ogre forums as well: http://www.ogre3d.org/forums/ Good luck and keep me posted! -Josh
Josh Developer Support Engineer Havok www.havok.com

Login to leave a comment.