From 6dd51a351bebd3347c1c4d9d8caf4d7b2f2a4338 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 25 Aug 2023 13:39:13 +0300 Subject: [WGL/P] Implemented very roughly simple ray marching, without support for anything --- Year 2/Computer Graphics with WebGL/Project/blackhole.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Year 2/Computer Graphics with WebGL/Project/blackhole.js (limited to 'Year 2/Computer Graphics with WebGL/Project/blackhole.js') diff --git a/Year 2/Computer Graphics with WebGL/Project/blackhole.js b/Year 2/Computer Graphics with WebGL/Project/blackhole.js new file mode 100644 index 0000000..50e7edb --- /dev/null +++ b/Year 2/Computer Graphics with WebGL/Project/blackhole.js @@ -0,0 +1,8 @@ +BlackHole = function(center, size) { + this.boundary = new Sphere(center, size); + this.rs = 2/3 * size; +} +BlackHole.prototype.draw = function() { + gl.vertexAttrib4fv(aSphere, [this.boundary.center[0], this.boundary.center[1], this.boundary.center[2], this.rs]); + this.boundary.draw(); +} -- cgit v1.3.1-26-gb76a