View Full Version : a 3d vertex fed in GL, how do you get screen 2d coord?

08-09-2000, 07:03 AM
There MUST be a way to do this. Does anyone know how you can do selection like Homeworld did? I can't figure out how to select ships in 3d in space. I can't use selection buffer because they can click and drag and selection buffer works only for single clicking.

mike j
08-09-2000, 10:33 AM
I think to get 2d coords you can use
gluProject() or gluUnproject() but I can't remember which

there is an example on how to do this in the

08-10-2000, 06:09 AM
You can use the selection buffer.

Record where you start the click and where the click ends (this will leave you with a rectangle) then set the gluPickMatrix to the proper coordinates and size.