diff --git a/ChaosGame/ChaosGame.js b/ChaosGame/ChaosGame.js index 2083c00..aa84d6f 100644 --- a/ChaosGame/ChaosGame.js +++ b/ChaosGame/ChaosGame.js @@ -114,8 +114,9 @@ function main() { gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); - // make an equilateral triangle of radius 0.8 - var triangle = new triangle2({type: "equilateral", radius: 0.8}); + // make an equilateral triangle of radius 0.8, centered in the clip space + const radius = 0.8; + var triangle = new triangle2({type: "equilateral", radius: radius, center: {x: 0, y: -radius/4}}); // initialize point p to a copy of one of the vectors var i, p = triangle.get_vertex(0)?.copy(); // loop for ten thousand years