Skip to main content
gamedev.net
🔒 Locked

Knowing your bounds...

Started by IllMind Oct 26, 2002 at 4:42 PM 1 replies 250+ views
Original Post
IllMind
IllMind
Quote from Nehe''s tutorial 13... "Because we translate one unit into the screen, the far left is -0.5, and the far right is +0.5." This was desribing the code (roughly)... glLoadIdentity(); glTranslatef(0.0f,0.0f,-1.0f); glRasterPos2f(-0.45f, 0.35); Now through trial and error, i have discovered the farthest left I can display the text that i print after the above lines, is actually -.552f. I plan on making a game using textures on quads and when the player goes off the right side of the screen he will appear on the left, so I need to know the bounds. I was going to do it all in projection mode at maybe 6 units into the screen, but now Im read some threads on ortho mode and im getting a bit confused. Can someone expain to me how i can know what my bounds are at a certian depth into the screen without just trying values until they work. Or should I be switching into ortho mode when I want to draw my sprites? I would like to impliment a partical engine in the near future that would simulate flames coming from the sprites so Im not sure if I would be able to use ortho mode. Also if anyone knows any good links for explaining the view modes, (ortho, projection, ?modelview?) let me know, (im gonna google it now ). Ive just begun learning openGL and Im begining to understand it (in projection mode), i think Also on a side note: Will I get any benifits if instead of drawing the quad verticies each frame, i create a display list for a quad and just draw that each frame? I plan on have a max of around 8 quads representing characters on the screen at a time. So will a display list help or is it unnessisary? Thanks
_the_phantom_
_the_phantom_
you could use some kind of culling test on the view volume to work out where your character is in relation to the drawing postions.

I cant be much more help with the details, too tired to engadge brain atm, however I''m sure someone else here can pick up the slack for me
TwistedMatrix
TwistedMatrix
well, im a brand spankin newbie to OGL, but I have used orthographic mode and projection mode at the same time to display a pixel perfect 2D foreground (I was using it to display the FPS, poly count, ect in my current and first OGL project)

I cant give much advice except that i would use rasters in ortho mode and not quads in projection mode for ANYTHING 2D that you want to be pixel perfect.

Im not sure how much of a preformance hit using orthomode and projection mode simotaniously causes. I would guess its substantal.

-= Twisted Matrix =-
Twisted Matrix

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.