Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING BOTH HTML AND JAVASCRIPT: Write a WebGL program that implements Michael Barnsley's 'chaos game'. A good template is HelloPoint2 from Chapter 2 of Matsuda

USING BOTH HTML AND JAVASCRIPT:

Write a WebGL program that implements Michael Barnsley's 'chaos game'. A good template is HelloPoint2 from Chapter 2 of Matsuda and Lea's textbook. 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 = 50000 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions