a thoughtful web.
Share good ideas and conversation.   Login or Take a Tour!
comment by rob05c
rob05c  ·  2272 days ago  ·  link  ·    ·  parent  ·  post: 'Whisper' suggestion

With regard to the OpenGL question:

In an orthographic projection, objects of different distances appear the same size. Which is unnatural. Objects farther away appear smaller in reality. You usually want perspective projection.

OpenGL has a series of matrices, which are applied in order when it draws.

The default initial matrix is GL_MODELVIEW, which is typically what you operate in and apply your transformations to move around your objects and things.

The GL_PROJECTION matrix is used to change the projection of the entire scene. For example, when the window is resized, you typically want to switch to the Projection matrix, call gluPerspective() with the new window coordinates, and then switch back to the ModelView Matrix.

Does that clear things up?

I just happen to have taken a Graphics class last semester. :)

iammyownrushmore  ·  2272 days ago  ·  link  ·  

On the original topic, if these are the little slices of information that could be accused of clogging up my feed, I'm A-ok with it, cause I just learned a thing.

caelum19  ·  2272 days ago  ·  link  ·  

Thank you! very helpful.

I'll be using ModelView. The plan is to translate every set of triangles contained in an Entity object to their x, y and z minus the camera's x, y and z, rotated to account for camera angle using cos, sin and tan magic with the Entity's rotation added on. Should that work?

rob05c  ·  2272 days ago  ·  link  ·  

Sounds good to me. You shouldn't need to use trig functions manually, though. OpenGL has translate and rotate functions.

Typically the way you draw an object is to push a matrix, apply the translations and rotations to where you want the object to be, draw the triangles and textures, and then pop the matrix, so you're back at the origin ready to draw the next object. So, OpenGL takes care of all the linear algebra and trig for you.