Modify Program 2.5 so that the vertex shader includes one of the buildRotate() functions from Program 3.1

Question:

Modify Program 2.5 so that the vertex shader includes one of the buildRotate() functions from Program 3.1 and applies it to the points comprising the triangle. This should cause the triangle to be rotated from its original orientation. You don’t need to animate the rotation.

Program 2.5Vertex Shader #version 430 void main(void) { if (gl_VertexID == 0) gl_Position = vec4( 0.25, -0.25, 0.0,

Program 3.1// builds and returns a translation matrix mat4 build Translate(float x, float y, float z) { mat4 trans =// builds and returns a matrix that performs a rotation around the Y axis mat4 build RotateY(float rad) {// builds and returns a scale matrix mat4 buildScale(float x,float y, float z) { mat4 scale = mat4(x, 0.0,

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Graphics Programming In OpenGL With JAVA

ISBN: 9781683922193

2nd Edition

Authors: V. Scott Gordon PhD, John L. Clevenger PhD

Question Posted: