Question: Modify Program 2.2 to add animation that causes the drawn point to grow and shrink, in a cycle. Hint: use the glPointSize() function, with a

Modify Program 2.2 to add animation that causes the drawn point to grow and shrink, in a cycle. Hint: use the glPointSize() function, with a variable as the parameter.

Program 2.2(.....imports as before) public class Code extends JFrame implements GLEventListener {private int renderinggl.glGenVertexArrays(vao.length, vao, 0); gl.glBindVertexArray(vao[0]); } private int createShader Program()int vShader = gl.glCreateShader(GL_VERTEX_SHADER); gl.glShaderSource(vShader, 3, vshaderSource, null, 0); //3

(.....imports as before) public class Code extends JFrame implements GLEventListener { private int rendering Program; private int vao[ ] = new int[1]; } new declarations public Code() { (..... constructor as before) } public void display(GLAutoDrawable drawable) { GL4 gl = (GL4) GLContext.getCurrentGL(); gl.glUse Program(renderingProgram); gl.glDrawArrays(GL_POINTS, 0, 1); } public void init(GLAutoDrawable drawable) { GL4 gl = (GL4) GLContext.getCurrentGL(); rendering Program = createShader Program();

Step by Step Solution

3.34 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!