LWJGL Forum

Programming => LWJGL Documentation => Topic started by: Gojira on March 24, 2017, 22:23:48

Title: Open GL Math Explained
Post by: Gojira on March 24, 2017, 22:23:48
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

Title: Re: Open GL Math Explained
Post by: jonasdev99 on May 06, 2017, 11:39:42
Very nice, thank you!  ;D
Title: Re: Open GL Math Explained
Post by: Evan407 on May 31, 2017, 12:17:14
Is there anything to make 3d ricocheting easier? With a vector and a triangle?
Title: Re: Open GL Math Explained
Post by: 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
Title: Re: Open GL Math Explained
Post by: Evan407 on May 31, 2017, 13:54:36
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?
Title: Re: Open GL Math Explained
Post by: Kai on May 31, 2017, 14:27:05
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)