diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-04 00:05:41 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-04 00:05:41 +0100 |
commit | 6aed8c493b2b1b7f58059a27e5fb240bc5361ade (patch) | |
tree | 2883bfdc9df9007eddb4576f6e63e6119c09c06f | |
parent | 5cca86a728b8421589a120e41e40f6fc541a73c8 (diff) |
launch cactus
-rw-r--r-- | cactus.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |