Center in clip space

This commit is contained in:
John 2022-06-23 15:54:01 -05:00
parent cd059c967b
commit b1936bdcb0

View File

@ -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