Open GL Math Explained

Started by Gojira, March 24, 2017, 22:23:48

Previous topic - Next topic

Gojira

I only took a quick look at this site, but it seems to be very good.  Explains mathematics behind many Open GL and game concepts.  They have a very detailed explanation of how the Open GL projection matrix is derived, which I found very helpful.

https://www.scratchapixel.com/index.php


jonasdev99


Evan407

Is there anything to make 3d ricocheting easier? With a vector and a triangle?

Kai

If by "3d ricocheting" you mean:

"Given the direction vector D of some object (a bullet) and a plane (a wall with normal vector N) which is hit by the bullet, then compute the reflection direction vector R as a reflection of D around N"

then the linear algebra for this is: https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector#answer-13266

Evan407

Quote from: Kai on May 31, 2017, 12:41:40
If by "3d ricocheting" you mean:

"Given the direction vector D of some object (a bullet) and a plane (a wall with normal vector N) which is hit by the bullet, then compute the reflection direction vector R as a reflection of D around N"

then the linear algebra for this is: https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector#answer-13266
Do you seriously expect me to use some dodgy source like that?

Kai

It does not actually matter which source you use for this. They'll all tell you the same thing.
Here's another one: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/reflect.xhtml
(no, I am not expecting you to implement it in GLSL. I am expecting you to look at the formula)