Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / blackhole.js
diff options
context:
space:
mode:
Commit6dd51a351bebd3347c1c4d9d8caf4d7b2f2a4338 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-25 13:39:13 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-25 13:39:13 +0300
Filesb408c20abe1d23b92075f1c22c898246f40d3c2b /Year 2/Computer Graphics with WebGL/Project/blackhole.js
uni-projects-6dd51a351bebd3347c1c4d9d8caf4d7b2f2a4338.tar
uni-projects-6dd51a351bebd3347c1c4d9d8caf4d7b2f2a4338.tar.gz
uni-projects-6dd51a351bebd3347c1c4d9d8caf4d7b2f2a4338.zip
Parent10889181959cada7e397ac377cb6d43dd977cf62 (diff)
[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.js8
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();
+}