This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Main | |
-- Cube | |
function setup() | |
parameter.number("ambient", 0, 1, 0.1) | |
parameter.number("diffuse", 0, 1, 1.0) | |
parameter.number("specular", 0, 1, 1) | |
parameter.color("lightColor", color(255,255,255,255)) | |
parameter.color("surfaceColor", color(191,41,85,255)) | |
allTextures = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Main | |
-- Cube World | |
-- Use this function to perform your initial setup | |
function setup() | |
print(math.floor(3/4)) | |
--print(3\4) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() | |
parameter.integer("value",1,3,1,set) | |
end | |
function draw() | |
background(40, 40, 50) | |
myMesh:draw() | |
end | |
function set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Classic 3d wireframe cube demo in LUA | |
-- based on version for PSP by Nils - ventoline.com | |
-- modified for Codea - Tom Bortels November 2011 | |
function setup() | |
--focal length to determine perspective scaling | |
focalLength = 300 | |
-- here we set up a function to make an object with | |
-- x, y and z properties to represent a 3D point. |