- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page