OpenGL in python e09 - perspective projection

preview_player
Показать описание
In this video we are going to take a look on, how to move the the cube from local space to clip space using a model matrix and a perspective projection matrix.

Рекомендации по теме
Комментарии
Автор

Thank you, I can say for sure that the little that i know in OpenGL today is thanks to you!

roquebarbosa
Автор

Just to add that the pyrr matrix44 creation functions don't require the Vector3 objects for their input. They require a list(array) of 3 values. So matrix44.create_from_translation([1, 1, 1]) is just as valid as having a Vector3([1, 1, 1]). In fact in the pyrr documentation they have stated that unless you specifically need the extended functionality of the Vector3() object(like swizzling) or the ease of just typing vector.x, you shouldn't be using the Vector objects since they take up more memory than a normal list would. But for the example in the tutorial this it's totally irrelevant.


I'm not sure have you touched on scale in the next videos, but a trick I found is that you can stack the matrix multiplication function calls. Like you can say
matrix44.multiply(rot, matrix44.multiply( scale, translate )) to recreate the model matrix on the CPU rather than in the GPU(in the vertex shader). I know I mentioned this to you before, but on stack overflow I saw a recommendation that the model matrix multiplications should happen on the CPU. Although it kind of makes you wonder, since the GPU is basically built for this...to make these calculations.


By the way that trick with the update viewport was really nice.

NikolaNevenov
Автор

First of all, I want to tank you for this tutorial. Also, I want to ask you, how can I build a resizable window (with this behavior, of course) using pygame instead of glfw?

steveanthonyluzquinosagama