Sfoglia il codice sorgente

Fix issues with planes in examples;

bjorn 7 anni fa
parent
commit
e53567a916
2 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 6 5
      examples/Billboard/main.lua
  2. 1 1
      examples/Primitives/main.lua

+ 6 - 5
examples/Billboard/main.lua

@@ -1,12 +1,13 @@
 function lovr.load()
-  eye = lovr.graphics.newMaterial( lovr.graphics.newTexture('eye.png') )
+  eye = lovr.graphics.newMaterial(lovr.graphics.newTexture('eye.png'))
 end
 
 function lovr.draw()
   local t = lovr.timer.getTime() * .5 + math.pi
-  local x = math.cos(t) * 2
-  local y = 2
-  local z = math.sin(t) * 2
+  local x = 0
+  local y = 3
+  local z = -5
+  local width, height = 1, 1
   local angle, ax, ay, az = lovr.math.lookAt(x, y, z, lovr.headset.getPosition())
-  lovr.graphics.plane(eye, x, y, z, 1, angle, ax, ay, az)
+  lovr.graphics.plane(eye, x, y, z, width, height, angle, ax, ay, az)
 end

+ 1 - 1
examples/Primitives/main.lua

@@ -38,7 +38,7 @@ function lovr.draw()
   -- Plane
   local x, y, z = -.6, 1.7, -1.5
   lovr.graphics.setColor(.94, .33, .31)
-  lovr.graphics.plane('fill', x, y, z, .4, lovr.timer.getTime())
+  lovr.graphics.plane('fill', x, y, z, .4, .4, lovr.timer.getTime())
 
   -- Cube
   local x, y, z = 0, 1.7, -1.5