Skip to main content
gamedev.net
🔒 Locked

Object selection

Started by Mihail121 Jul 28, 2002 at 1:28 AM 0 replies 550+ views
Original Post
Mihail121
Mihail121
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!!!

Topic Locked

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

Sign in to reply to this topic.