Interactive Computer Graphics -3(2)

 

Question 1.

Using WebGL [call gl.drawElements( ) function] render points at coordinates:

-0.4, -0.3, 0,0

 0.5, -0.5, 0.0

 0.6,  0.7, 0.0

-0.3, -0.4, 0.0

Make the canvas width = 600, height = 600, border orange and the points black.

Question 2.

Using WebGL [call drawElements()function]render the rectangle using the following coordinates:

 0.45,  0.45,  0.0

-0.45,  0.45,  0.0  

-0.45, -0.45, 0.0

0.45, -0.45, 0.0

Make the canvas with = 470, height = 470, border red and the rectangle green.