0
$\begingroup$

As the title says, you are able to compose the ViewMatrix and the ProjectionMatrix into one instead of multiplying a vector by the individual matrices.

Instead of doing this at run time for each item: Vector * ViewMatrix -> Vector ProjectionMatrix

Do this at the start: ViewMatrix * ProjectionMatrix -> ComposedMatrix

Then when drawing vectors: Vector * ComposedMatrix

This would minimize the number of necessary matrix multiplications. Is there any reason not to do this?

$\endgroup$
  • 2
    $\begingroup$ Yes, that's what people do. Matrix multiplication is (theoretically) associative, so $((vA)B)C = v(ABC)$. $\endgroup$ – lightxbulb Jul 3 at 15:22
  • $\begingroup$ Thanks for the information $\endgroup$ – Nixcc Jul 3 at 19:56
  • 1
    $\begingroup$ But usually it is projectionmatrix * viewmatrix * positionvector $\endgroup$ – Thomas Jul 5 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.