PDA

View Full Version : Picking

Batti
05-23-2002, 02:13 AM
Hi everyone!

I read-in objects from a 3d-file and would like to pick a 3d object to display a related string. Displaying it will not be the problem, but I donīt know how to do picking as I did not fully understand the chapter in the red book. I have only one glVertex call, which draws all the points of the scene. Do you have any hints how to proceed? (I fear the question is a bit general..)

JeeTriX
05-23-2002, 02:22 AM
jep, it's a bit general if you want a specific answer on it...

paste your code here if it's so simple http://www.opengl.org/discussion_boards/ubb/smile.gif

Batti
05-23-2002, 02:51 AM
Ok, Iīm sorry!
The few lines are written in Fortran, hope it does not matter.

real*4
* px,py,pz, !+ Normals

if(ksteu.eq.1)then !+ksteu=1->new area
if(ipena.gt.-1) call glend()
ipena=0
call glbegin(gl_polygon)
call glNormal3f(px,py,pz)

else if(ksteu.eq.2)then !+ksteu=2->point of area
//all material properties and colours

dpx=(px-xm0)*scal0 !+xm0.. center of cubus
dpy=(py-ym0)*scal0 !+scal0 is a constant
dpz=(pz-zm0)*scal0
call glvertex3d(dpx,dpy,dpz) !+The one and only draw command

else if(ksteu.eq.4) then !+ksteu=4->end of area
call glend()

I tried to reduce it to a readable size. Does it help?