Jump to content
  • Advertisement
Sign in to follow this  
amatsuka

please tell me about attack by mouse

This topic is 4427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i want to know about attack by mouse and contact npc. when i put mouse on monster and npc. i want to know about that monster and npc name. i can use picking???? i use DirectX. could you please sugges me. thank you so much.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by amatsuka
i want to know about attack by mouse and contact npc.
when i put mouse on monster and npc.
i want to know about that monster and npc name.
i can use picking????

could you please sugges me.
thank you so much.


This is a case where ray picking can be used. In fact, this is how it is implemented in most games I know of.

Don't forget to select only the closest meaningful intersected object :)

Regards,

Share this post


Link to post
Share on other sites
now i know about picking but when i click at monster.
i want to know that monster is?
because picking tell me about true or false.

Share this post


Link to post
Share on other sites
Quote:
Original post by amatsuka
now i know about picking but when i click at monster.
i want to know that monster is?
because picking tell me about true or false.


It should also returns the object you picked - if it fails to do this, it is rather useless :)

Have a look to this for a proper implementation of ray picking. The DX SDK sample also gives a good example of how to implement it.

Both implemenations can be converted to OpenGL if you need it.

More about object selection with ray picking can be found on google

Regards,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!