Software Archive
Read-only legacy content
17061 Discussions

Selection Buffer

Intel_C_Intel
Employee
159 Views
Hi
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

hits=ownfglrendermode(GL_RENDER)
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?

Thanks
Kausik
0 Kudos
0 Replies
Reply