Assigment 1: ToyLOGO
Computer Graphics assignment 1
Implementation of standard commands
CLS, COL, BGCOL: Used standard Opengl functions.
F,B,MF,MB: Next position is calculated using sine and cosine components of the distance to be moved from current postition.
REPEAT: Iterator is used to iterate the execution of commands that appear between REPEAT and ENDREP
SCALE:
Used Opengl scaling transformation function.
Implementation of Bonus commands
PAUSE:
clock() is used to get current time. Goal time is set as per the argument passed to the function.
Looping is done until current time reaches to goal time.
glFlush() is used for updating the screen.
Fractal: Lindenmayer System:
A line of Length L is drawn as base. Subsequent lines are drawn at 2/3rd height of the base line, with lengths equal to 2L/3 and at an angle of 120 degrees in the right and left directions.Color grading is done based on the current length of the line.
Screenshot of various results
Fractal drawing: Lindenmayer System
Test Example: Example 3 logo program
Unique Drawing