Jump to content

  • Log In with Google      Sign In   
  • Create Account


Ray Picking animated mesh


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 gogogo   Members   -  Reputation: 104

Like
0Likes
Like

Posted 19 August 2012 - 09:25 PM

Hi everyone.

I am currently working on ray picking stuffs and I am happy and successfully done ray picking with static mesh.

But now, I found that my ray picking code, which is commonly posted on the internet and in the DirectX sdk demo (the D3DXIntersect()), cannot work in animated mesh, like characters.

So, what should I change the code so that I can pick the animated mesh accurately?

Thanks all guys!

Sponsor:

#2 Saoblol   Members   -  Reputation: 143

Like
0Likes
Like

Posted 20 August 2012 - 01:45 AM

The transformed mesh is only temporarily created during the vertex shader, not in your game logic code where you do the picking. You will have to create the transformed mesh in your code to be able to pick it, but depending on the complexity of your animation and the amount of animated objects in your scene, this can use up a lot of processing power. If you got multiple objects (e.g. units on a battlefield) I would first do a picking via a normal hitbox, and then check for intersection with the detailed animated mesh.

#3 gogogo   Members   -  Reputation: 104

Like
0Likes
Like

Posted 20 August 2012 - 09:18 PM

Thanks!

#4 Tom KQT   Members   -  Reputation: 1497

Like
0Likes
Like

Posted 22 August 2012 - 01:49 AM

If you got multiple objects (e.g. units on a battlefield) I would first do a picking via a normal hitbox, and then check for intersection with the detailed animated mesh.

You should even consider whether you need the second step, maybe a hitbox picking is enough? This of course depends solely on what you are doing and what you want/need to achieve.

#5 Starnick   Members   -  Reputation: 1133

Like
0Likes
Like

Posted 22 August 2012 - 02:17 PM

If you need finer picking, for that second step, one idea would be to create a "collision mesh" (e.g. take a look at Valve's Source SDK) that is a simplified version of the animated model. Another possibility would be representing the model as a series of smaller hitboxes, e.g. one that moves with the head bone, another that moves with the torso bone, several that represent the arms/legs, etc.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS