Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by seb_krueger · May 16, 2019 at 12:32 PM · renderingvrmathmatrixprojection

Is this a valid projection matrix and why?

Hi,

from several AR/VR headset I keep getting projection matrices, having non zero value in the second column/ first row.
I wasn't able to find an explanation for this. Is it possible that this is related to some lens correction effect?

Thanks

Edit: This is some example projection matrix data (Samsung Odysee Plus MRTK v2):


0.8804515  -0.00124849  -0.08054376      0
0           0.7055852    0.0006020069    0
0           0           -1.0002         -0.20002
0           0           -1               0

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image elenzil · May 16, 2019 at 06:36 PM 0
Share

could you include a specific example.

avatar image elenzil · May 16, 2019 at 06:40 PM 0
Share

are you sure it's the projection matrix and not a world/view matrix ?

avatar image seb_krueger elenzil · May 21, 2019 at 07:18 AM 0
Share

please see my edit

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · May 21, 2019 at 05:17 PM

Well, first of all I recommend to read through my Matrix crash course (If you have trouble reading due to UnityAnswers broken Markdown rendering, I have a clone on github).


Next thing to realise is that matrices can only do affine transformations. Thanks to homogeneous coordinates we can actually do a perspective projection as well as translation with a matrix. Any other non linear operation is not possible using a matrix since matrix multiplication only uses multiplication and addition. So lens distortion can not be fixed with a matrix. Only linear factors can be used (offsets, rotations or shear operation. Even trapezoid transformations are not possible since they are not affine)


To describe what the "3 unusual" values do I start with the 2 values in the 3rd column. Like i explained in my crash course they essentially shift the center of perspective left / right and up / down. However if you look closely on the values you will realise they are quite small. So they are just calibration values for the camera. You have a shift of about 9% on the vertical axis and about 0.09% on the horizontal axis.


The other unusual value (second column, first row) is really unusual for a projection matrix. It will cause a shear operation. However again if you look at the value (0.0012) it's very close to 0. It would cause a slight shear angle of about 0.08 degree. So the vertical lines are tilted by about 0.08°. At a vertical resolution of 1080p that would be about 1.5 pixels off. (So a vertical line from top to bottom would end 1.5 pixels to the left / right from the starting point). Using 0 for this value wouldn't cause almost no change at all.


ps:
I did already write a similar answer 4 days ago but I wasn't home and only had access to a "rudimentary PC". When I submitted the answer, UA decided to give my a 504 Gateway timeout and it was gone for good. So this is a complete rewrite ^^.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image seb_krueger · May 23, 2019 at 07:25 PM 0
Share

Thanks for the link! I already know about matrix math and how to construct a projection matrix. But that is why I wonder where the second column, first rows value is co$$anonymous$$g from. Though the shear is negligible, someone has an idea why some of the mixed reality headsets are setting it.

avatar image Bunny83 seb_krueger · May 23, 2019 at 07:57 PM 0
Share

Well who knows. It could be a fragment of a more complex calculation / calibration routine. The same way when you calculate the inverse of a certain matrix and multiply the original with its own inverse the result is essentially the identity matrix with some close to zero values off the main diagonal.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

157 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to project a 3D object onto the screen 0 Answers

How to use two cameras in VR to display 3D object on top of UI panel? 0 Answers

Can DrawMeshInstancedProcedural be used with Single Pass Instanced Rendering in Unity XR project? 0 Answers

VR mirror view custom size and FoV 0 Answers

Cardboard VR Optimization and single pass on 2019.4.1f1 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges