changeset 1141:d3e014c3551c

fix: cude example perspective matrix
author sam <sam@basx.dev>
date Sat, 08 Jun 2024 15:19:58 +0700
parents 5934c5615f13
children bf9dedd36bed
files examples/E03_hello_cube.nim
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/examples/E03_hello_cube.nim	Sat Jun 08 15:16:17 2024 +0700
+++ b/examples/E03_hello_cube.nim	Sat Jun 08 15:19:58 2024 +0700
@@ -56,7 +56,11 @@
         Attr[Mat4]("model"),
       ],
       outputs = [Attr[Vec4f]("color")],
-      vertexCode = """outcolor = color; gl_Position = (Uniforms.projection * Uniforms.view * Uniforms.model) * vec4(position, 1);""",
+      vertexCode = """
+      outcolor = color;
+      // gl_Position = vec4(position, 1) * (Uniforms.model * Uniforms.projection * Uniforms.view);
+      gl_Position = vec4(position, 1) * (Uniforms.model * Uniforms.projection * Uniforms.view);
+      """,
       fragmentCode = "color = outcolor;",
     )
   var matDef = MaterialType(name: "default material", vertexAttributes: {"position": Vec3F32, "color": Vec4F32}.toTable)