Archived

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

Mihail121

Object selection

Recommended Posts

Hi,i haven''t net for quite a while so i coudn''t answer the object selection problems but now it''s different.So let''s get to the point.When you are trying to select some object or a singe pixel that are quite away in the frustrum you can use a bigger selection viewing volume.This is done by the following function call: gluPickMatrix(m_pos.x,viewport[3] - m_pos.y,3,3,viewport) where viewport represents the current viewing volume and can be get with the function glGetIntegerv(GL_VIEWPORT,viewport).The m_pos.x and m_pos.y are the center of the selection volume that means you have a 3 sided cube with center m_pos.x and m_pos.y.Everything that is in that cube is a selection hit.There are very easy tricks to get which object is nearest to the viewer.Some of that tips can be readed at http://www.gametutorials.com. Another way to get which object is selected with the mouse is the FEEDBACK buffer but that''s alot harder. Take care Minski The pain is coming...this sommer!!!

Share this post


Link to post
Share on other sites