0
$\begingroup$

I am currently writing an AR experience. I have a Camera View Matrix, A Camera Perspective matrix and the Model Matrix of the content I display.

The AR content should can be switched to "2D", so it is attached to the screen.

For this, I have predefined Model, View and Projection Matrices.

I would like to create an interpolation between "Content in Room" and "Content attached to screen" How would I achieve this? enter image description here

My first idea was to calculate both MVPs and sending them both to the shaders and giving each shader an interpolation factor (I would interpolate the vertices)
This would work out I think, but I don't know if this causes deformations during interpolation.

$\endgroup$
2
  • $\begingroup$ (Very generally speaking)Interpolating between two matrices using euler angles isn't always intuitive and can lead to artifacts, it may just be a heck of a lot easier to introduce a rotation matrix and either pass it to the shader as a uniform or premultiply the rotation matrix with the model matrix each frame. It looks like this will rotate around the x axis so the actual rotation shouldn't be to hard to calc. There may be a scale involved to I am just now thinking, but there again...it is more like computing your way to the new matrix rather then interpolation. $\endgroup$
    – pmw1234
    Commented Oct 20, 2021 at 11:03
  • $\begingroup$ Interpolation between rotations is done through slerp for quaternions and there's a corresponding operation for rotation matrices. You provide two orientations and a parameter $t$ to interpolate between. See: geometrictools.com/Documentation/RotationIssues.pdf $\endgroup$
    – lightxbulb
    Commented Oct 21, 2021 at 9:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.