Skip to content

Tutorial 6 challenge - model rotation without changing camera projection #332

Answered by sotrh
mipli asked this question in Q&A
Discussion options

You must be logged in to vote

This solution requires reuploading all the vertices, which is an expensive operation. It works, but if you need to do this for hundreds of models, your code will get really slow. The intended solution involves creating a separate matrix known as a model matrix.

Basically each model gets it's own matrix that you use to position it in the world. This gets passed into the vertex shader where you multiply it with the camera's matrix to transform the vertices.

I should probably update the challenge.rs to use this method. I think I just got a bit lazy.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mipli
Comment options

Answer selected by mipli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants