Selection Buffer

Selection Buffer

I am trying to pick objects using selection buffer. But I am unable to set up the glupickmatrix for a small portion of the viewing volume. This is what I did:

call fglselectbuffer(256,loc(selectbuffer))
call fglgetintegerv(GL_VIEWPORT,loc(viewport))

call fglmatrixmode(GL_PROJECTION)
call fglrendermode(GL_SELECT)
call fglloadidentity()
! the values are in screen coordinates
call fglupickmatrix(matx,my-maty,200,200,loc(viewport))

call fglortho(dble(xo),dble(x1),dble(yo),dble(y1),dble(-10.0),dble(10.0))
call fglmatrixmode(GL_modelview)

!render the object here

call fglmatrixmode(GL_MODELVIEW)
call fglpopmatrix()

But I always end up selecting the whole screen and not the specified portion of the screen. Am I missing out something or am I doing anything wrong ? Can anyone help me out here?


1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.