Archived

This topic is now archived and is closed to further replies.

New Picking Alternitive

This topic is 5013 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 don''t like the concept of ''picking'' with openGL, i thought up this algorythem just now, can you tell me if thiers any flaws with it? ok, you cast a ray from your eye/body/whatever you want to check with. every object has a x,y and z location. if the ray you cast the ray untill it is blocked by a colision box. the ray returns the x,y and z location were it was blocked. you have a index of all the objects in the world and thier x,y,z location, prehaps put it in a tree to speed up the process a bit. can any one figure out anything wrong with this. my whole theroy behind this is that everything has sense organs, which they can probe the world with.

Share this post


Link to post
Share on other sites
That works fine. That''s how most games do it. Using picking for collision testing is... very wrong.

Note that if you want to tell whether A sees B, you''d want to send a ray between A''s eyes and some number of points on B (say, each box vertex, plus the center) and return true if any of the rays make it without hitting something else, first.

Share this post


Link to post
Share on other sites
You just are wanting to figure how to tell if an object see''s another object? The more complex way would be to get that objects view frustrum and then find which object are in it, then to cast a ray to those ojbects and make sure something isn''t in there way (which can lead to many errors).

I suppose a quick answer then would be there is no real easy way to tell if object sees another. To do it perfectly you would have to the frustrum test, and then do a ray for each triangle. This still wouldn''t be 100% due to transparent surfaces.

So I think the best is to mabye just see where the objects are in relation to each other (front, behind, aboves, etc..) Put some limits on how much you can see, and then cast a ray from the eyes of the seeing object to the bounding volume of the object seen. If the ray is obtruded by something else then it doesn''t see if, if not, then it does.

Share this post


Link to post
Share on other sites