-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.8 - Model Matrix #64
Comments
Hi, as long as you represent the transformation using affine matrices (i.e. 4x4 matrices if your points have 3 coordinates), you can simply combine them by multiplying them together as we did in the class. The order matters, and you need to figure out which one is correct for your specific problem. Hope this helps! |
Hi Professor, |
It is acceptable, but it is unnecessary and harmful for performances. You should try to minimize the amount of things that you send to the shader, and I don't see any reason (for this specific case) to do the product of the three matrices inside the shader instead that on the cpu side before uploading the uniform. |
I'm confused how to factor in the barycenter subtraction/addition we need to perform for scaling/rotation into the model matrix.
I am able to upload the model matrix as a uniform, but combining 1. subtraction of the barycenter 2. multiplying for scale and 3. addition of the barycenter into the model matrix gives the scaling factor correctly in the first 2 columns, but the the last column for adding/subtracting the barycenter is just 0.
How are we supposed to force the above order (1, 2, 3) in a single model matrix?
The text was updated successfully, but these errors were encountered: