a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by caelum19
caelum19  ·  3589 days ago  ·  link  ·    ·  parent  ·  post: 'Whisper' suggestion

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  ·  3589 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.