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

  • Home
  • SEARCH
  • 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 35847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:18:01+00:00 2026-05-10T14:18:01+00:00

I’m trying to do a simple rotation in OpenGL but must be missing the

  • 0

I’m trying to do a simple rotation in OpenGL but must be missing the point. I’m not looking for a specific fix so much as a quick explanation or link that explains OpenGL rotation more generally.

At the moment I have code like this:

glPushMatrix();   glRotatef(90.0, 0.0, 1.0, 0.0);   glBegin(GL_TRIANGLES);             glVertex3f( 1.0, 1.0, 0.0 );             glVertex3f( 3.0, 2.0, 0.0 );             glVertex3f( 3.0, 1.0, 0.0 );           glEnd(); glPopMatrix(); 

But the result is not a triangle rotated 90 degrees.

Edit Hmm thanks to Mike Haboustak – it appeared my code was calling a SetCamera function that use glOrtho. I’m too new to OpenGL to have any idea of what this meant but disabling this and rotating in the Z-axis produced the desired result.

  • 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. 2026-05-10T14:18:01+00:00Added an answer on May 10, 2026 at 2:18 pm

    Do you get a 1 unit straight line? It seems that 90deg rot. around Y is going to have you looking at the side of a triangle with no depth.

    You should try rotating around the Z axis instead and see if you get something that makes more sense.

    OpenGL has two matrices related to the display of geometry, the ModelView and the Projection. Both are applied to coordinates before the data becomes visible on the screen. First the ModelView matrix is applied, transforming the data from model space into view space. Then the Projection matrix is applied with transforms the data from view space for ‘projection’ on your 2D monitor.

    ModelView is used to position multiple objects to their locations in the ‘world’, Projection is used to position the objects onto the screen.

    Your code seems fine, so I assume from reading the documentation you know what the nature of functions like glPushMatrix() is. If rotating around Z still doesn’t make sense, verify that you’re editing the ModelView matrix by calling glMatrixMode.

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

Sidebar

Related Questions

No related questions found

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.