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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:53:32+00:00 2026-06-03T22:53:32+00:00

glScalef(0.5f, 0.5f, 0); // do some things glScalef(2.0f, 2.0f, 0); Or.. glPushMatrix(); glScalef(0.5f, 0.5f,

  • 0
glScalef(0.5f, 0.5f, 0);
// do some things
glScalef(2.0f, 2.0f, 0);

Or..

glPushMatrix();
glScalef(0.5f, 0.5f, 0);
// do some things
glPopMatrix();

Which is better, performance wise?

  • 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-03T22:53:34+00:00Added an answer on June 3, 2026 at 10:53 pm

    The second one. Because the first one computes and multiplies a 4×4 matrix, while the second only writes and reads it. Note that OpenGL can be intelligent about it and only create/multiply a diagonal matrix. Nevertheless, you are comparing 3 floating point multiplications with 16 variable stores. If you are concerned about the difference in performance, you need to write a test.

    Precision-wise, the second one is definitely better because due to whatever rounding error 0.5 * x * 2 might give a different value than x. This is why, even if the other method is slightly faster, this method is preferred.

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

Sidebar

Related Questions

Guys, I'm trying to finish up my homework but I'm having some problems here
To zoom into the mouse position I was using: glTranslatef(current.ScalePoint.x,current.ScalePoint.y,0); glScalef(current.ScaleFactor,current.ScaleFactor,current.ScaleFactor); glTranslatef(-current.ScalePoint.x,-current.ScalePoint.y,0); so basically
I have an OpenGL ES scene which is made up of about 20 objects.
I am using glScale() to zoom out whole game scene. But at some scales
I use this method which works perfectly to draw a full circle(might be typos
I have an OpenGL ES object which I am trying to draw. The object
I drew some quad like this with OpenGL: _______ _______ | || | |
I'm drawing a number of texture-mapped rectangles which are sat on top of each
I've got some 2D geometry. I want to take some bounding rect around my
I have a an odd problem with some texturing in opengl: This scene is

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.