[SOLVED] ComputerGraphics - A01 - Paint by numbers

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

The WebGL application contained in file index.html, wants to draw the bullet-shaped pattern represented in blue, with the red lines using the code written in file draw.js.

 

If you open index.html in Google Chrome or in some other WebGL supported browser, you will see that the current version of the code written in file draw.js draws an X and a line.

 

Find the appropriate set of normalized screen coordinates to match the blue pattern with red lines and correct the code in function draw() of file draw.js. For the moment, please ignore the content of file index.html. The grid, whose spacing in 0.1, should help you in finding the correct coordinates of the end points of the considered lines. Use the appropriate for() statement, with functions Math.sin() and Math.cos(), to draw the circular part, by approximating it with a 64 small lines.

 

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.