Question: Modify Program 14.3 to clip the torus along the horizontal, creating a circular trough. Program 14.3 Java/JOGL application: public void display(GLAutoDrawable drawable) { ... flipLoc

Modify Program 14.3 to clip the torus along the horizontal, creating a circular “trough.”

Program 14.3Java/JOGL application: public void display(GLAuto Drawable drawable) { ... flipLoc = gl.glGetUniform Location// rendering of back faces with normals reversed gl.glUniform1i(flipLoc, 1); gl.gl FrontFace(GL_CW);

Java/JOGL application: public void display(GLAutoDrawable drawable) { ... flipLoc gl.glGetUniform Location (rendering Program, "flipNormal"); gl.glEnable(GL_CLIP_DISTANCEO); // normal drawing of external faces gl.gl Uniform1i(flipLoc, 0); gl.glFrontFace(GL_CCW); gl.glDrawElements(GL_TRIANGLES, num Torus Indices, GL_UNSIGNED_INT, 0);

Step by Step Solution

3.42 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To modify Program 143 to clip the torus along the horizontal creating a circular trough you need to ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Graphics Programming Questions!