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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:16:42+00:00 2026-05-23T12:16:42+00:00

I am going through a series of NeHe OpenGK tutorials. Tutorial #9 does some

  • 0

I am going through a series of NeHe OpenGK tutorials. Tutorial #9 does some fancy stuff; I understood everything, except for two things which I think are the back bone of the whole tutorial.

In the DrawGlScene function, I didn’t understand the following line.

glRotatef(tilt,1.0f,0.0f,0.0f);  // Tilt The View (Using The Value In 'tilt') 

I understand what that line does and it is also very clearly mentioned in the tutorial. But I don’t understand why he wants to tilt the screen.

The other thing is first he tilts the screen and then rotate it by star angle and immediately after that he does the the reverse of that. What is that technique? What needs to tilt? Just rotate the star when the star faces the user.

glRotatef(star[loop].angle,0.0f,1.0f,0.0f); // Rotate To The Current Stars Angle
glTranslatef(star[loop].dist,0.0f,0.0f);    // Move Forward On The X Plane

glRotatef(-star[loop].angle,0.0f,1.0f,0.0f); // Cancel The Current Stars Angle
glRotatef(-tilt,1.0f,0.0f,0.0f);             // Cancel The Screen Tilt

I will be really thankful if some body tells me the mechanism going on under the hood.

  • 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-23T12:16:43+00:00Added an answer on May 23, 2026 at 12:16 pm

    I don’t understand why he wants to tilt the screen.

    Tilting makes you see the stars in another angle and not just “right above” them.

    The other thing is first he tilts the screen and then rotate it by star angle and immediately after that he does the the reverse of that. What is that technique?

    That is because he wants to rotate the star around the selected plane (in this case Y plane), but (!) he also want the textured quad to face the viewer. Let us say he rotate it 90 degrees, if so, you would only see (like he states in the tutorial) a “thick” line.

    Consider these comments:

    // Rotate the current drawing by the specified angle on the Y axis 
    // in order to get it to rotate.
    glRotatef(star[loop].angle, 0.0f, 1.0f, 0.0f); 
    
    // Rotating around the object's origin is not going to make 
    // any visible effects, especially since the star object itself is in 2D.
    // In order to move around in your current projection, a glRotatef()
    // call does rotate the star, but not in terms of moving it "around" 
    // on the screen.
    // Therefore, use the star's distance to move it out from the center.  
    glTranslatef(star[loop].dist, 0.0f, 0.0f);
    
    // We've moved the star out from the center, with the specified 
    // distance in star's distance. With the first glRotatef() 
    // call in mind, the 2D star is not 100 % facing
    // the viewer. Therefore, face the star towards the screen using 
    // the negative angle value.
    glRotatef(-star[loop].angle, 0.0f, 1.0f, 0.0f);
    
    // Cancel the tilt on the X axis.
    glRotatef(-tilt, 1.0f, 0.0f, 0.0f);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going through the rails by example tutorial series. I'm trying my best to
I was going through the Hilo tutorial series Developing C++ Applications for Windows 7
Going through some of my older Delphi projects and upgrading them to D2009, as
Going through Javascript documentation, I found the following two functions on a Javascript object
Going through the microsoft authentication tutorial listed here they have you create a master
Going through some WCF hosting questions on StackOverflow, I've seen Dublin mentioned a few
What I'm trying to do involves going through a series of checkboxes. For each
I was going through (using Squeak) the Discovering Better Code: Bowling for Smalltalk Series
I'm going through the http://www.SecurityTube.net video series on Windows Assembly . The examples make
I am just trying to learn some Lisp, so I am going through project

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.