Sign in to follow this  
Ritti

skinnedmesh & instancing

Recommended Posts

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

Share this post


Link to post
Share on other sites
You might find nVidia's [url="http://developer.download.nvidia.com/SDK/10.5/direct3d/samples.html#SkinnedInstancing"]Skinned Instancing[/url] 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).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this