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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:27:27+00:00 2026-06-18T18:27:27+00:00

To give some background on the issue I am using Box2D and am trying

  • 0

To give some background on the issue I am using Box2D and am trying to use the built in debug draw functionality to create a debug overlay that will allow me to see the physics bodys’ actual shapes over the game’s graphics. The issue arises in the combination of a moving view system implemented by translating and rotating the modelview matrix before rendering the scene and the fact that Box2D coordinates are a smaller scale factor of screen coordinates (in the case of the current project I am multiplying screen coordinates by .05 to get box2D coordinates). Both features work correctly independently.

When it is time to use Box2D’s debug rendering I can make the scaling work easily by scaling the modelview matrix but only if it has not already be transformed at all by the view system. After that if I apply the same transformations to the scaled modelview as I did to the original using the view system I get the correct results. I know how I can make it work in a rather costly way but it would be a lot easier if there was some way to insert the transformation (aka use prefix multiplication instead of the usual postfix) in OpenGL.

I am using the old OpenGL built in matrices without shaders, so I am only manipulating matrices using functions like glTranslate and glRotate. Is there a way of directly reading/writing the values in the matrix or else some sort of OpenGL setting for how to apply transformations?

  • 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-18T18:27:28+00:00Added an answer on June 18, 2026 at 6:27 pm

    Is there a way of directly reading/writing the values in the matrix

    Yes there is glGetDoublev (I recommend using double precision for this) which can query the current matrices on the individual stacks. See http://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml

    Then you can use

    glPushMatrix();
    glLoadIdentity();
    your_transformation();
    glMultMatrix(queried_matrix);
    

    To apply your own transformation before what was on the stack. Use glPopMatrix to clean up after yourself.

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

Sidebar

Related Questions

To give some background on my issue: I have 3 tables called Products, Packages,
The Issue Just to give you some background, I'm currently enrolled as a student
Background: I have encoded a raw h264 file using ffmpeg. I'm trying to create
To give some background, I am making a UINavigationControlled-based blog type app (I suppose
I would really like some advice here, to give some background info I am
Can someone give me some info/background info on how I might go about writing
I've been give some lovely Java code that has a lot of things like
Anybody please give some useful links on this topic.i need to create a content
firstly I'll give some background regarding the situation. I have a website containing approximately
-Let me give some background first- My assignment is to take a given senario

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.