Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a WebGL program that implements Michael Barnsley's 'chaos game'. Store the coordinates of three vertices v1 = (x1,y1), v2 = (x2,y2), and v3 =
Write a WebGL program that implements Michael Barnsley's 'chaos game'. Store the coordinates of three vertices v1 = (x1,y1), v2 = (x2,y2), and v3 = (x3,y3) and an initial point p0 = (x0,y0). The vertices should be chosen to form a well-shaped triangle centered in the clip coordinate space [-1,1] X [-1,1]. Implement the following loop: Initialize p = (x,y) to p0 = (x0,y0) n = 40000 for i = 0 to n-1 Select v from the set {v1,v2,v3} at random. Set p to the midpoint between v and the previous value of p. Render a point at p with PointSize = 1 using gl.drawArrays. end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started