skinnedmesh & instancing

Started by
1 comment, last by Ritti 12 years, 6 months ago
Hi.

I adapted the skinnedmesh sample from the dx sdk to act as a strategy game. So i have a raptor which I can move to the cursor in 3d space, collision detection and multiple animations.

Now I have to show more than one raptor 'cause you will have more than one of the same unit in a strategy game ^^. I think the best way doing this is instancing.

I know the multianimation sample but its a little to complicated, and in addition I cant use my own meshes (I can switch view and hear walking sounds but it wont show up anything)

What do I have to do to have multiple instances? What do I have to clone exactly (I think the frameroot and animcontroller but I'm not sure)? And how can I copy them during runtime and keep them separated so that my raptors wont do all the same animation?



Edit: And how can I move them separately? If I select one and rightklick on the world only the selected one should move and not all instances (I think to know how to select one)

but do I need a separate world for each instance or is there an other way to do this more efficient?



Thanks in advance



Ritti
Advertisement
You might find nVidia's Skinned Instancing demo very useful.

to move them separately, you should pass a transform matrix in your per-instance data that represents there current position/rotation/scale at the time period the instance is rendered (may be a more efficient way however).
Yeah thank you, this sample will help me a lot to understand how instancing works :)

Thanks again, Ritti

This topic is closed to new replies.

Advertisement