From 56ad7214c6c5e06f71ae9f1eb24b864e47a865fe Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 19 Jan 2023 14:34:13 -0500 Subject: rename --- public/cube.js | 28 ++++++++++++++++++++++++++++ public/index.html | 2 +- public/shader/simple.frag | 7 ------- public/shader/simple.vert | 15 --------------- public/test.js | 28 ---------------------------- 5 files changed, 29 insertions(+), 51 deletions(-) create mode 100644 public/cube.js delete mode 100644 public/shader/simple.frag delete mode 100644 public/shader/simple.vert delete mode 100644 public/test.js diff --git a/public/cube.js b/public/cube.js new file mode 100644 index 0000000..631591d --- /dev/null +++ b/public/cube.js @@ -0,0 +1,28 @@ +import * as GL from '/gl/gl.js' + +const main = () => { + + var Renderer = new GL.Renderer() + var Scene = new GL.Scene() + var Camera = new GL.Camera() + var SimpleController = new GL.SimpleController(Camera) + + var Shader = GL.SimpleShader() + + var Material = new GL.Material(Shader) + + var Mesh = GL.Cube() + + var Cube = new GL.Entity(Mesh) + Cube.position.z = 3; + + Scene.add(Material, Cube) + + GL.Loop(() => { + Renderer.draw(Scene, Camera) + Cube.rotation.add(new GL.Vec3(1,1,1)) + SimpleController.update(GL.DT) + }); +} + +main() \ No newline at end of file diff --git a/public/index.html b/public/index.html index b5cc309..3f6b5e5 100644 --- a/public/index.html +++ b/public/index.html @@ -6,6 +6,6 @@ - + \ No newline at end of file diff --git a/public/shader/simple.frag b/public/shader/simple.frag deleted file mode 100644 index d23373f..0000000 --- a/public/shader/simple.frag +++ /dev/null @@ -1,7 +0,0 @@ -precision mediump float; - -varying vec3 color_pass; - -void main() { - gl_FragColor = vec4(color_pass, 1.0); -} \ No newline at end of file diff --git a/public/shader/simple.vert b/public/shader/simple.vert deleted file mode 100644 index 09db32e..0000000 --- a/public/shader/simple.vert +++ /dev/null @@ -1,15 +0,0 @@ -precision mediump float; - -attribute vec3 position; -attribute vec3 color; - -uniform mat4 proj; -uniform mat4 view; -uniform mat4 tran; - -varying vec3 color_pass; - -void main() { - color_pass = color; - gl_Position = proj * view * tran * vec4(position, 1.0); -} \ No newline at end of file diff --git a/public/test.js b/public/test.js deleted file mode 100644 index 631591d..0000000 --- a/public/test.js +++ /dev/null @@ -1,28 +0,0 @@ -import * as GL from '/gl/gl.js' - -const main = () => { - - var Renderer = new GL.Renderer() - var Scene = new GL.Scene() - var Camera = new GL.Camera() - var SimpleController = new GL.SimpleController(Camera) - - var Shader = GL.SimpleShader() - - var Material = new GL.Material(Shader) - - var Mesh = GL.Cube() - - var Cube = new GL.Entity(Mesh) - Cube.position.z = 3; - - Scene.add(Material, Cube) - - GL.Loop(() => { - Renderer.draw(Scene, Camera) - Cube.rotation.add(new GL.Vec3(1,1,1)) - SimpleController.update(GL.DT) - }); -} - -main() \ No newline at end of file -- cgit v1.2.3-freya