Vertex Tweening Animation with DirectX

Started by
4 comments, last by programmer_tom 18 years ago
I am using Vertex Blending/Tweening techniques in DirectX whether you do it by shaders or through normal rendering states. The question I have is that is there anyway to retrieve the mesh/model generated by the tweening for use in Collision Detection? The only way I can think of doing it is manually tweening every vertex but my models have tons of vertices(poser models), so that is definitely out the question. Any thoughts, ideas, comments on the matter?
Advertisement
You might be able to get somewhere with IDirect3DDevice9::ProcessVertices().

Short of doing software skinning/morphing/tweening I don't think you'll get the information you want.

There might be others, but one I've seen mentioned before:

Create a series of bounding boxes around the limbs of your character (e.g. one per bone) and then morph these on the CPU. That way you can get fairly accurate collision detection without having to deal with the real geometric complexity of the model. If you really need triangle-level accuracy you could (once past a bounding-box test) transform the relevant triangles and test accordingly...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

I figured that much, ProcessVertices() seems okay but I think it would have to be more on a precalculated level. It's just a general problem I've had trying to animate some 3d models.

Poser seems to not export bone information with any of the export formats it has so I'll look into writing my own export plugin with it's python library.

Also, using the PandaX Exporter for DirectX Files in 3D studio max seems to cause problems when trying to include animations and bones. I can export a .max scene as a single mesh and it will render correctly with materials, textures, and everything else. When including the animations and bones, when rendering the X format cause tons of warping and spikeyness within the model. I guess there is something about the limit of bones or weights with the X format but I'm not sure.

I'm really just trying to find a good way to use Poser models and their animations altogether but if need be I can animate the models in 3ds max and export to X file format.
ProcessVertices() is in general very slow. I wouldn't use it for this. JJ's suggestion of bounding volumes around the major parts is probably best. DX10 will allow better retrieval of processed vertices, but that won't be mainstream for years still.
[sub]My spoon is too big.[/sub]
CPU side is probably the best choice, being compatible with all systems and a rather simple calculation.

An alternative would be storing vertex positions in textures and using a pixel shader to tween. On the Radeon X1x00 cards you could then use R2VB to read the results in the vertex shader, but even without this you could read this back. Whether the speed of doing it on the GPU is worth it with the overhead of readback (and the more complex code) is something you'd have to see for yourself.
dude just tween a few vertices on the CPU, and build bounding boxes around them. we use max and insert 'dummy' frames for our boned models, but in tweening you should just be able to interpolate a few vectors during the animation.

-programmer_tom

This topic is closed to new replies.

Advertisement