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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:02:32+00:00 2026-05-18T11:02:32+00:00

For context, I’m trying to model a simple 1×1 lego brick in OpenGL. I

  • 0

For context, I’m trying to model a simple 1×1 lego brick in OpenGL. I setup my camera to look at the origin and ‘up’ is in the Y direction. I’m trying to draw a cylinder for the little nub on the cube, and cannot figure out how to rotate it. C++ code:

//draw cylinder
glPushMatrix();
glTranslated(0.0, 0.4 , 0.0);
//glRotatef(angle, 1.0f, 0.0f, 0.0f);   
GLUquadricObj * qobj = gluNewQuadric();
gluCylinder(qobj, 0.24, 0.24, 0.18, 16, 16);
glPopMatrix();

I’m trying to rotate it around the x axis by 90 degrees but glRotatef doesn’t appear to do anything, or just makes the whole thing disappear. What am I missing?

  • 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-18T11:02:33+00:00Added an answer on May 18, 2026 at 11:02 am

    Worked well for me:

    glPushMatrix();
    GLUquadricObj * qobj = gluNewQuadric();
    glTranslated(0.0, 0.4 , 0.0);
    glRotatef(angle * 10, 0.0f, 1.0f, 0.0f);   
    gluCylinder(qobj, 1.24, 1.24, 1.18, 16, 16);
    gluDeleteQuadric(qobj);
    glPopMatrix();
    

    No matter which order of glRotate and glTranslate i’ve used.

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

Sidebar

Related Questions

Context: I'm making a simple solar system simulation in c++/OpenGL. Research: I've tried searching
Context I am trying to understand the internals of a big, hairy JavaScript library.
Context I want to use JavaFx with clojure. I am aware of http://nailthatbug.net/2011/06/clojure-javafx-2-0-simple-app/ Question:
Context: I setup a photo upload that uses an iframe to upload the image,
Context: As a personal learning project I've been working on a simple computer algebra
Context I am writing a simple JUnit test for the MyObject class. A MyObject
Context: So, I am attempting to build a ridiculously complex domain model. Talking with
Context I'm learning C, and I'm trying to reverse a string in place using
Context : I am trying to put up a Decorator pattern in Ruby. As
Context: I'm working with a relatively simple winforms application, written in VB.NET on the

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.