Please continue more amazing videos like this. for a channel this size it's a miracle to find something like this and it's only going to grow bigger. Thanks!
@code-imposter Жыл бұрын
Thank you sir :)
@theman705010 ай бұрын
Thanks, man. Helpful :)
@code-imposter10 ай бұрын
Glad it helped!
@stefanstefanowski993810 ай бұрын
complicated stuff, but I think I understand most of it except matrix multiplication. Why does it have to be in reversed order?
@code-imposter10 ай бұрын
That's a brilliant question, because the order of matrix multiplication is a strange thing to be honest, it really is... the only way I managed to start appreciating why the order (in general) made sense was by analysing the geometry, i.e. literally drawing the geometry so that I could visually see what was happening within the 3D structure (vector representation). Typically, we get told "Matrix multiplication is not commutative", which is true, but what is that really saying? For example, changing the order of multiplication does indeed produce a different result, which in some cases might be considered an error, but in other cases, and to be more precise, it's actually just different! E.g. sometimes we deliberately reverse the order of multiplication of rotation matrices depending on whether we want to produce either local or global rotations, as I've shown geometrically in the following video... kzbin.info/www/bejne/d5jGo6ybmq6bm9k Another example is if we want to rotate on the spot vs rotating travelling in an orbit... kzbin.info/www/bejne/oWSbm4KVrZ2KZsU Similarly, if we were to follow (and analyse) the rules of matrix with respect to View * Model... vs Model * View, we would get to see, geometrically, what is really going on. I realise that ultimately this is your question, but I haven't yet analysed this properly for myself, and so I haven't yet made a video illustrating it, otherwise I'd provide the link of course :) In this video though, I mainly just wanted to show how model, world, and view space, are all just 3D space. Near the end (at 7:59) after illustrating NDC space, I then mention about clip space, but there's a more detailed analysis of clip space near the end of this video... kzbin.info/www/bejne/oWTdc6Ntj8Z2iNEsi=kKz7JFUBNsKI8BbM&t=456
@cuppajoeman8569 Жыл бұрын
Model and world space are just arbitrary levels of scope, what if we then have a universe space, where the world is embedded in, totally possible, and we could do that forever making as many levels of scope as we want. Instead of doing that though the general practice of just having 2 levels of scope has sufficed for the most part. The view space is a totally different concept, unlike you and I who can move around space and look at things. opengl is like the laziest person in the world who is staring at a TV and won't turn their head, if you want opengl to see something you're going to have to bring it into their field of vision, they're so lazy in fact that if you want to make it seem like an object is moving, they expect you to manipulate the entire world to make it seem like it is. That's why you to transform your objects over time and then apply perspective transformations. All of this is achieved through linear transformations from R^4 to R^4, being in a higher dimension than our current allows us to simulate things that are impossible using linear transformations in R^3, such as translating the object in space without scaling or rotating them. Every linear transformation has a representation as a matrix, and we use those because computers can operate with them quickly.
@code-imposter Жыл бұрын
Yeah I think of model, world, and view space, all as just being 3D space, but even then, within 3D space, imagine the implications for collision detection for example… let’s say a car crashes into something (model/world space) - graphically the car’s position exists within the 3D world scene, but it also exists in the game physics for things like collision detection. And so in contrast to model/world space, we can say we have view space, which like you say OpenGL (the view matrix in this case) brings the scene into our field of vision accordingly, but although the view matrix transforms models graphically, that’s purely for visual purposes, and so it doesn’t affect things such as collision detection between characters, whereas model space does. Indeed linear algebra is used for all the transformations (apart from converting 3D space depth values to NDC space). Essentially, the projection matrix (perspective transformations) just transforms 3D space to 2D screen space, but as shown in the video, that involves nothing more than a couple of triangles. I agree we can’t live without matrices in computer graphics, and I’ve found the more I understand about the linear transformations they contain, the better overall control I have.