Modify Program 4.4 so that the view matrix is constructed using the look-at function. Then experiment with

Question:

Modify Program 4.4 so that the “view” matrix is constructed using the “look-at” function. Then experiment with setting the “look-at” parameters to various locations, such as looking at the sun (in which case the scene should appear normal), looking at the planet, or looking at the moon.

Program 4.4private Matrix4fStack mvStack = new Matrix4fStack(5); public void display(GLAuto Drawable drawable) { //gl.glDrawArrays(GL_TRIANGLES, 0, 18); mvStack.popMatrix(); ||------- cube == planet} //-- smaller cube == moon mvStack.pushMatrix(); mvStack.translate(0.0f, (float)Math.sin(tf)*2.0f, (float)

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: