Jump to content
  • Advertisement
Sign in to follow this  
codemastermm

Emulate 3D Mouse Pointer

This topic is 4721 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

This is a tad hard to explain, but what I'd like to do is make it so let's say I have a few 3D models, one far away, one close and them both sitting on terrain of some sort. I'd like to somehow emulate the mouse to act like it's 3 dimensional rather than 2 dimensional, such as that I can move the mouse across the terrain (perhaps lighting up each small face as you go across it) and selecting the clower model and then selecting the farther model. I apologize that this is hard to explain and any help is greatly appreciated :)

Share this post


Link to post
Share on other sites
Advertisement
simply make the cursor three dimensional...? :)

I.e, capture the mousemovements, and instead of moving the cursor up and down (y), move it in and out (z) instead... :)


but, this is not a nice way to do selecting of units in RTS games etc... better to have a 2D mouse which projects a line onto the world... and the intersected object gets selected... :)

Share this post


Link to post
Share on other sites
Actually, this was implemented in Black and White, and it was pretty cool. The way , you can achive (because the cursor needs to be in worldspace) this is:
Watch the change in the 2D cursor position. Increment (or in the case of negative values, decrement) the position with the delta value (the change in the 2D position). As Rasmadrak said, change in z instead of y.
Hope this helps a little

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!