diff options
[WGL/P] Implemented very roughly simple ray marching, without support for anything
1 files changed, 8 insertions, 0 deletions
| -rw-r--r-- | Year 2/Computer Graphics with WebGL/Project/blackhole.js | 8 |
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(); +} |
