Hello,
I am new to Codea (and coding in general) and have found this site to be extremely useful. I’ve used this site to learn how to draw meshes and how to call functions, but I’m a bit stuck when it comes to combining the two techniques. I’m sure it’s something really simple that I am doing incorrectly.
Problem: I can draw meshes just fine when I include them in “Main”, but I cannot get my meshes to draw when I try to call it as a function.
Thank you all for your help.
function setup()
triangle = meshTest()
--triangle = mesh()
--triangle.vertices = {vec2(0,0),vec2(100,0),vec2(0,100)}
end
function draw()
background(40, 40, 50)
strokeWidth(5)
triangle:draw()
end
-- The code below is on a different tab --
meshTest = class()
function meshTest:init()
self.mesh = mesh()
self.vertices = {vec2(0,0),vec2(100,0),vec2(0,100)}
end
function meshTest:draw()
self.mesh:draw()
end