Lab6
Lab6
Step 1 − The program should accept two points, the starting point (x1, y1) and the ending point
(x2, y2) as an input. To accomplish this, you have to create four input boxes as shown in the
screenshot below.
Step 2 − Create a button with click event. When the user clicks the draw button, the program will
execute a function called drawLine.
Step 3 − The drawLine function should follow the bresenham’s line drawing algorithm
explained in chapter 5.
Step 4 − Create and compile Shader programs
We write vertex shader and fragment shader programs, compile them, and create a combined
program by linking these two programs.
Step 5 − Associate the shader programs with buffer objects
We associate the buffer objects and the combined shader program.
Step 6 − Drawing the required object
Exercise:
Modify the sample program provided (drawBresenham.html) so that it can handle the following
scenarios:
If m > 1 If m = 1
Reference