Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7856931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:52:04+00:00 2026-06-02T20:52:04+00:00

I’ve read through several over-complicated articles on rendering a 3D scene with OpenGL, and

  • 0

I’ve read through several over-complicated articles on rendering a 3D scene with OpenGL, and haven’t really found something that helps me to visualize the basic concepts of scene navigation with respect to glRotate and glTranslate calls.

From experimenting with the examples provided by LWJGL (my particular OpenGL library), I understand very basically what effect comes of their use. I can use glTranslate to move to a point, glRotate to rotate about that point, and glLoadIdentity to snap back to the origin or glPopMatrix to go back to the last glPushMatrix, which are essentially snapshots of a location and rotation. Finally, the scene will render to screen with respect to the origin.

So basically, to put a cube at point A with rotation B:

  1. glTranslate(A.x,A.y,A.z) [now focused on point A]
  2. glRotate(B.,,*,*) for pitch, yaw, and roll; [now rotated to rotation B]
  3. glBegin(GL_QUADS) and glVertex3f()x4 for each ‘side'(quad) relative to object’s origin
  4. glEnd()
  5. glLoadIdentity() [reset to origin for other objects, not needed if only drawing the cube]

As for the “camera”, since openGL’s “eye” is fixed, the scene has to move inversely from the camera in order to simulate moving the eye with the camera. This is my understanding so far, and if this is wrong, please put me on the right path.

Now for my specific situation and question:

My ‘scene’ consists of terrain and a player (some arbitrary shape, located at a terrain-relevant location and a ‘camera’ head). The view should rotate with respect to the player, and the player move with respect to the terrain. I want the final rendering to essentially “look through” the player’s head, or camera. My confusion is with the order of translate/rotate calls for rendering each part, and the direction of translation. Is the following the proper way to render the terrain and player with respect to the player’s “camera”?

  1. translate away from the player by the player’s distance from origin (move the scene)
  2. rotate away from the player’s rotation (player looks 40 degrees right, so rotate scene 40 left)
  3. render terrain
  4. reset via glLoadIdentity
  5. render player’s head (if needed)
  6. translate to body/hands/whatever position
  7. rotate away from the player’s rotation (step 2 again)
  8. render body/hands/whatever

Also, does rotating have an effect on translation? Aka, does OpenGL translate with respect to the rotation, or does rotation have no bearing on translation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:52:07+00:00Added an answer on June 2, 2026 at 8:52 pm

    I can use glTranslate to move to a point, glRotate to rotate about that point, and glLoadIdentity to snap back to the origin or glPopMatrix to go back to the last glPushMatrix, which are essentially snapshots of a location and rotation.

    No not quite. Those functions have now idea of what a scene is. All they do is manipulating matrices. Here’s an excellent article about it:

    http://www.opengl.org/wiki/Viewing_and_Transformations

    One important thing to keep in mind when working with OpenGL is, that it is not a scene graph. All it does is rendering flat points, lines and triangles to the framebuffer. There’s no such thing like a scene you navigate.

    So basically, to put a cube at point A with rotation B:
    (…)

    Yes, you got that one right.

    As for the “camera”, since openGL’s “eye” is fixed

    Well, OpenGL got no camera. It’s only pushing vertices through the modelview matrix, does lighting calculations on them, then passes them through the projection and maps them to the viewport.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.