Question: Modify Program 4.1 to replace the cube with some other simple 3D shape of your own design. Be sure to properly specify the number of

Modify Program 4.1 to replace the cube with some other simple 3D shape of your own design. Be sure to properly specify the number of vertices in the glDrawArrays() command.

Program 4.1Java/JOGL Application import java.nio.*; import javax.swing.*; import java.lang.Math;import static com.jogamp.opengl.GL4.*; import com.jogamp.opengl.*; import com.jogamp.opengl.awt.GLCanvas;// allocate variables used in display() function, so that they won't need to be allocated during renderingpublic void init(GLAutoDrawable drawable) { GL4 gl= (GL4) GLContext.getCurrentGL(); rendering Program =public void display(GLAutoDrawable drawable) { GL4 gl = (GL4) GLContext.getCurrentGL();} // copy perspective and MV matrices to corresponding uniform variables gl.glUniformMatrix4fv(mvLoc, 1,private void setupVertices() { GL4 gl= (GL4) GLContext.getCurrentGL(); // 36 vertices of the 12 triangles} } -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f,

Java/JOGL Application import java.nio.*; import javax.swing.*; import java.lang.Math;

Step by Step Solution

3.36 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

We will approach the given task in the below manner 1 Remove the cubes 36vertex array 2 Replace it w... 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!