From 53c352887fdb3e0345e97c2760d8f7985a1bfc48 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 28 Aug 2023 13:01:49 +0300 Subject: [WGL/P] Added a lot of comments and reworked formatting of certain code --- Year 2/Computer Graphics with WebGL/Project/star.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 Year 2/Computer Graphics with WebGL/Project/star.js (limited to 'Year 2/Computer Graphics with WebGL/Project/star.js') diff --git a/Year 2/Computer Graphics with WebGL/Project/star.js b/Year 2/Computer Graphics with WebGL/Project/star.js deleted file mode 100644 index 8aad803..0000000 --- a/Year 2/Computer Graphics with WebGL/Project/star.js +++ /dev/null @@ -1,20 +0,0 @@ -Star = function(center, size, starsBuf) { - if (starsBuf.length == STAR_MAX_COUNT) - throw 'Error: cannot add more stars, limit of ' + STAR_MAX_COUNT + ' reached!' - - this.sphere = new Sphere(center, size); - this.sphere.color = [0.956,0.5,0.215]; - this.index = starsBuf.push([]) - 1; - this.center = center; - - this.sphere.center = center; - starsBuf[this.index] = center.concat(this.sphere.size); -} -Star.prototype.moveTo = function(newCenter, starsBuf) { - this.sphere.center = newCenter; - starsBuf[this.index] = newCenter.concat(this.sphere.size); - gl.uniform4fv(gl.getUniformLocation(glprog, 'uStars[' + this.index + ']'), starsBuf[this.index]); -} -Star.prototype.draw = function() { - this.sphere.draw(); -} -- cgit v1.3.1-26-gb76a