Coder Social home page Coder Social logo

Comments (3)

barcharcraz avatar barcharcraz commented on June 14, 2024 1

from gtavisionexport.

barcharcraz avatar barcharcraz commented on June 14, 2024

So all the transformation matrices are "graphics style" instead of vision style. In graphics we like to keep everything 4x4, since it's (a) better aligned in memory, (b) does not discard any information. The view matrix transforms things from "world space" to "camera space". This is rigid. The projection matrix goes from there to normalized device coordinates, which is some cube, usually with sides of 2 units. The actual transformation into image space (or fragment space) gets done for us on the graphics card.

The reason that all elements are nonzero is because we pull these transforms out of GPU memory before a render call, and GTA sends just one transformation to the GPU, (P * V). We then construct a view matrix based on the camera location as reported by the scripting API and use it to extract just the projection matrix. The nonzero elements come about from floating point precision losses during this process. The nonzero elements (aside from the usual nonzero elements of a projection matrix) should be quite close to zero.

The depth is in NDC space.

from gtavisionexport.

racinmat avatar racinmat commented on June 14, 2024

Thanks for answers. I am still not sure whether I understood all of it.
What exactly is the device coordinates and how does it differ from the "camera space"?
And I did not get that "with sides of 2 units" means.
So when actual transformation into image space gets done for us on the graphics card, does it mean that it's not possible to calculate it from matrices in the postprocessing, but we need to calculating during the extraction, when GTA V is running, via the native call for transformation?

from gtavisionexport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.