Skip to main content
gamedev.net
🔒 Locked

Picking problem...

Started by aker_jus Jan 25, 2003 at 12:51 PM 3 replies 200+ views
Original Post
aker_jus
aker_jus
Well, it is not actually a problem, more like something to be added. I have finished my picking function for my mesh class, which successfully checks if the mouse is picking this mesh. This works excellent!! However, if I have another mesh in front of the mesh i am testing the pick on, it will still pick it even if it is totally behind the other mesh.. How can I prevent this from happenning?
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
aker_jus
aker_jus
Helloooooo??
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Pipo DeClown
Pipo DeClown
kinda strange dont you think?
how do you check it anyways?
Muhammad Haggag
Muhammad Haggag
Sort your objects (meshes) near to far. Test ray-mesh intersection starting with the nearest mesh. If it intersects a mesh, stop the test.

Mete
Mete
The pick sample from the SDK shows how to sort intersections by distance. In fact the sample also allows to pick the nearest intersection only.

- Mete

[edited by - Mete on January 27, 2003 8:11:20 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.