• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

glDrawPixels() disappears when camera moves past its point at 0,0

Hi how do I stop the image renderd by glDrawPixels() from disappearing when the opengl gl camera moves past the 0,0 point of the image ?

Mark
0
Paladin_VB
Asked:
Paladin_VB
  • 4
  • 4
1 Solution
 
_corey_Commented:
When you say move past point 0,0, do you mean just moving the camera at all?  

How is your raster and zoom setup?

corey
0
 
Paladin_VBAuthor Commented:
I have the pixel / raster zoom at 10 times.  The image disappears when the 0,0 point of the shape is no longer on the opengl camera view. It just suddenly dispeeares , I move the camera backwards a bit, and it flicks into position .
0
 
_corey_Commented:
Well, I'm assuming then that the raster position has become invalid due to clipping or something else.

corey
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Paladin_VBAuthor Commented:
Fixed it :)


10.070 How do I draw glBitmap() or glDrawPixels() primitives that have an initial glRasterPos() outside the window's left or bottom edge?

When the raster position is set outside the window, it's often outside the view volume and subsequently marked as invalid. Rendering the glBitmap and glDrawPixels primitives won't occur with an invalid raster position. Because glBitmap/glDrawPixels produce pixels up and to the right of the raster position, it appears impossible to render this type of primitive clipped by the left and/or bottom edges of the window.

However, here's an often-used trick: Set the raster position to a valid value inside the view volume. Then make the following call:

glBitmap (0, 0, 0, 0, xMove, yMove, NULL);This tells OpenGL to render a no-op bitmap, but move the current raster position by (xMove,yMove). Your application will supply (xMove,yMove) values that place the raster position outside the view volume. Follow this call with the glBitmap() or glDrawPixels() to do the rendering you desire.

0
 
_corey_Commented:
Yea, that's what I was going to suggest in the last post but forgot to ask for your current code that does the positioning and drawing :)

Glad to see you found that!

corey
0
 
Paladin_VBAuthor Commented:
oowh I have a problem , this code seems a bit bad for my game , unless im implementing it badly , which is quite possible. As well as my "spaceship" moving ,  the bitmap is moving around the spaceship at the same time !!! lols help !

Ive looked into GL_CLIP_VOLUME_CLIPPING_HINT_EXT , but my opengl doesn't support it , is there any way just to disable clipping ? ?

Thanks Mark

(point boost *2)
0
 
_corey_Commented:
Hrm, I don't know if you would really want clipping disabled anyway.

However, can you explain what you're trying to do with the bitmap drawn via DrawPixels?  Is there any reason a texture couldn't just be used?

corey
0
 
Paladin_VBAuthor Commented:
Good point  , there isn't really a reason why a texture couldnot  be used !!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now