summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-04 00:05:41 +0100
committerubq323 <ubq323@ubq323.website>2024-04-04 00:05:41 +0100
commit6aed8c493b2b1b7f58059a27e5fb240bc5361ade (patch)
tree2883bfdc9df9007eddb4576f6e63e6119c09c06f
parent5cca86a728b8421589a120e41e40f6fc541a73c8 (diff)
launch cactus
-rw-r--r--cactus.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/cactus.lua b/cactus.lua
index b5624d9..7a43da8 100644
--- a/cactus.lua
+++ b/cactus.lua
@@ -36,10 +36,11 @@ end
local function rotatev(v,nq)
-- rotates v by n quarters
nq = nq%4
- for i = 1,nq do
- v.x,v.z = -v.z,v.x
+ if nq == 0 then return vector.new( v.x, v.y, v.z)
+ elseif nq == 1 then return vector.new(-v.z, v.y, v.x)
+ elseif nq == 2 then return vector.new(-v.x, v.y, -v.z)
+ elseif nq == 3 then return vector.new( v.z, v.y, -v.x)
end
- return v
end
local v = vector.new(1,0,0)