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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:50:00+00:00 2026-06-12T08:50:00+00:00

I’m working on an OpenGL project in Java, and it has come to point

  • 0

I’m working on an OpenGL project in Java, and it has come to point where I’d like to create the transformation matrices in my own code, so i can use them to do world-to-screen point transformations, and vice versa. I’ve created a Matrix class with support for transformations, and that is all working quite nicely. However, I’m having trouble actually figuring out how to create an inverse transform.

So my question is this:

  • Given an arbitrary affine (4×4) transformation matrix, how do you create the inverse transformation matrix? Are some matrices uninvertible? What are the limitations and caveats of inverting a transformation matrix?

From my research, I’ve heard various methods of doing so, with the simplest being to transpose then negate the matrix. However, this doesn’t seem to be actually working. I’ve heard that this method doesn’t work on some matrices, and even that some matrices are uninvertible.

I’m looking for more than just a “plug in this equation” answer, because I’d actually like to understand what’s going on when I invert a matrix. This also excludes “just use this library” answers. I might move to a matrix library in the future, but for now I’d like to create it myself.

Edit: Before anyone asks, this is NOT homework. This is a personal project.

Edit: Apparently there’s a whole list of strategies for calculating inverse matrices here: http://en.wikipedia.org/wiki/Invertible_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-06-12T08:50:02+00:00Added an answer on June 12, 2026 at 8:50 am

    Here is some code that I used in my Computer Graphics course, basically I used the Gauss Jordan elimination for calculating the inverse of a matrix. For a matrix to be invertible its determinant value must be not equal to zero. I have not handled that case in my code though, I am not going to do it all for you.

    Matrix4* Matrix4::FindInverse(Matrix4 &a){
    
    int n = R;
    int i = 0;
    int j = 0;
    float pivot = 0;
    Matrix4* invA = NULL;
    //TODO: Check whether the matrix is invertible.Else Return
    invA = new Matrix4();
    invA->SetMatrix4(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1);
    
    
    for(i = 0; i < n; i++){
        pivot = a.v[i][i];
    
        if(pivot != 1.0 and pivot != 0){
            for(int t = i; t < n; t++){
                a.v[i][t] = a.v[i][t]/pivot;
                invA->v[i][t] = invA->v[i][t]/pivot;
            }
        }
    
        //Update to the new pivot which must be 1.0
        pivot = a.v[i][i];
    
        for(j = 0; j < n; j++){
            if( j==i ){
                continue;
    
            }
            else{
                float l = a.v[j][i]/pivot;
                for(int m = 0; m < n; m++){
                    a.v[j][m] = a.v[j][m] - l * a.v[i][m];
                    invA->v[j][m] = invA->v[j][m] - (l * invA->v[i][m]);
                }
            }
        }
    }
    return invA;
    

    }

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.