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 6930657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:28:33+00:00 2026-05-27T11:28:33+00:00

I am trying to get everything up and running with my engine but am

  • 0

I am trying to get everything up and running with my engine but am having trouble figuring out what order to add objects and lights to get everything rendered correctly.

I set up my projection and modelview matrix in my itialization:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();                            

gluPerspective(75.0f,(GLfloat)width/(GLfloat)height, 0.1f , 1000.0f);

glMatrixMode(GL_MODELVIEW);                         
glLoadIdentity(); 

Then, when I am rendering geometry, I clear the buffer and load the identity matrix and update my camera.

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

// Camera updates
glRotatef(camera.anglePitch, 1.0f, 0.0f, 0.0f);
glRotatef(camera.angleYaw, 0.0f, 1.0f, 0.0f);
glTranslatef(-camera.position.x, -camera.position.y, -camera.position.z);

// Now render
level.render();

My view of my level is a camera, which I gather is eye coordinates moving around. I am trying to render objects and lights in my level and have them show up in the correct places.

I need to add the objects at specific points in the world. For instance, a torus at (10, 10, 25). Is there anything I need to do before I render this torus objects that will make them appear correctly at 10, 10, 25? Do I need to render and then translate them for instance?

Also, part 2 has to do with lights. It is pretty much the same question. What consideration do I have to have when rendering say a light at 50, 50, 50? Can I just position the light normally or do again do I have to translate it to there? Or am I over thinking this?

  • 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-05-27T11:28:34+00:00Added an answer on May 27, 2026 at 11:28 am

    If I understand the issue, I would agree that you are overthinking this. The transformations from glTranslate and glRotate are applied to the modelview matrix, by which all your vertices are multiplied to provide the eye coordinates that will later be clipped in projection. The same transformations are applied to your lights as well.

    You can also use glPopMatrix and glPushMatrix to apply different states of the modelview matrix to different vertices.

    I would also refer you to question 9.070 in http://www.opengl.org/resources/faq/technical/transformations.htm

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

Sidebar

Related Questions

I'm trying to get prettyPhoto to work, but I seem to be running into
I´m trying to get RoR up and running with mysql data base, but it
I am trying to get a GUI running for a C++ application but I
I'm trying to get a Yii program running, but I get the error: Application
I am having issues trying to get the django-debug-toolbar up and running. I have
I'm trying to get Ember running with BPM based on these instructions: https://github.com/bpm/bpm/wiki/Using-BPM-with-SproutCore-2.0 Everything
I've bee tearing my hair out trying to get MySQL 5 running on CentOS
I'm trying to get rid of everything before the filename ex: /home/mike/whatever/test_1.txt leaving only
Trying to get an ASP application deployed; it worked for a while but then
I am trying to get my Django project running on the production server. I

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.