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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:08:46+00:00 2026-05-24T13:08:46+00:00

I have 2D transformations stored in a plain ol’ 3×3 Matrix. How can I

  • 0

I have 2D transformations stored in a plain ol’ 3×3 Matrix. How can I re-format that one to a Matrix I can shove over to OpenGL in order to transform orthogonal shapes, polygons and suchlike.

How do I have to put the values so the transformations are preserved?

(On an unrelated note, is there a fast way to invert a 3×3 Matrix?)

  • 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-24T13:08:47+00:00Added an answer on May 24, 2026 at 1:08 pm

    Some explanation about transformation matrices: All the columns, except the last one, describe the orientation of a new coordinate system in the base of the current coordinate system. So the first column is the X vector of the new coordinate system, as seen from the current, the second is the new Y vector and the 3rd is the new Z. So far this only covers the rotation. The last column is used for the relative offset. The last row and the bottom most right value are used for the homogenous transformations. It’s best to leave the last row 0, …, 0, 1

    In your case you’re missing the Z values, so we just insert a identity transform there, so that incoming values are left as they are.

    Say this is your original matrix:

    xx xy tx
    
    yx yy ty
    
     0  0  1
    

    This matrix is missing the Z transformation. Inserting identity means: Leave Z as is, and don’t mix with the rest. So ·z = z· = 0, except zz = 1. This gives you the following matrix

           ↓
    
    xx xy  0 tx
    
    yx yy  0 ty
    
     0  0  1  0  ←
    
     0  0  0  1
    

    You can apply that onto the current OpenGL matrix stack with glMultMatrix if OpenGL version is below 3 core profile. Be aware that OpenGL numbers the matrix in column major order i.e, the indices in the array go like this (hexadecimal digits)

    0 4 8 c
    1 5 9 d
    2 6 a e
    3 7 b f
    

    This contrary to the usual C notation which is

    0 1 2 3
    4 5 6 7
    8 9 a b
    c d e f
    

    With OpenGL-3 core and later you’ve to do matrix management and manipulation yourself, anyway.

    EDIT for second part of question

    If by inverting one means finding the matrix M^-1 for a given matrix M, so that M^1 * M = M * M^1 = 1. For 3×3 matrices the determinant inversion method requires less operations than Gauss-Jordan elemination and is thus the most efficient way to do it. Already for 4×4 matrices determinant inversion is slower than every other method. http://www.sosmath.com/matrix/inverse/inverse.html

    If you know that your matrix is orthonormal, then you may just transpose the upper left part except bottom row and rightmost column, and negate the sign of the rightmost column, except the very bottom right element. This exploits the fact that for orthonormal matrices M^-1 = M^T.

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

Sidebar

Related Questions

I have an ETL process that involves a stored procedure that makes heavy use
I'm having a little trouble with my OpenGL transformations -- I have a vertex
I have some (untyped) XML being stored in SQL Server 2005 that I need
Here is the problem. I have a stored procedure that transforms normalized data into
A seemingly simple issue, I have an off-screen bitmap that I perform some transformations
I am starting to think that short of OpenGL I can't drag around a
When processing an open xml document, colors can have various transformations applied to a
From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by
The problem I have is that I need to do about 40+ conversions to
I have an iphone app that uses Core Data to do storage. I have

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.