style(1): Switch to industry standard
This commit is contained in:
parent
561541b10f
commit
385a06f531
1 changed files with 5 additions and 10 deletions
|
@ -26,18 +26,13 @@ mat4 model(bool is_moon, float time)
|
|||
// Based on:
|
||||
// https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/#cumulating-transformations
|
||||
|
||||
mat4 scale_matrix = uniform_scale(0.30);
|
||||
|
||||
float r = 2.0;
|
||||
mat4 translation_matrix = translate(vec3(r, 0, 0));
|
||||
|
||||
// TODO Why is PI not defined?
|
||||
float full_rotation = 2 * 3.14159;
|
||||
float full_rotation = 2 * M_PI;
|
||||
float theta = full_rotation * time / 4.0;
|
||||
mat4 rotation_matrix = rotate_about_y(theta);
|
||||
|
||||
// Small hack to make the moon rotate around the origin
|
||||
// Usually you would rotate first, then translate
|
||||
return rotation_matrix * translation_matrix * scale_matrix;
|
||||
float x = r * cos(theta);
|
||||
float z = r * sin(theta);
|
||||
|
||||
return translate(vec3(x, 0, z)) * rotate_about_y(theta) * uniform_scale(0.30);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
|
Reference in a new issue