fixed drawing of cylinders (physics with ODE doesn' work anyway), fixed re-rendering managed object when the color changes, added managed_objects demo

git-svn-id: svn://anubis/anaglym/trunk@134 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop committed 2009-10-28 03:32:07 +00:00
1 parent e0d20f1a2b
commit 1d97d948fc
3 files changed
+46 -6

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
ground = ag.createStaticPlane(0, 0, 0, 0, 0, 0)
ground:setColor(0.2, 1.0, 0.2)
ag.setCamera(10, -10, 10, 0, 0, 0)
function init(obj)
obj:setColor(math.random(), math.random(), math.random())
obj:setPosition((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, 10)
end
function key_down_event(key)
if (key == "b") then
box = ag.createBox(1, 1, 1)
init(box)
-- elseif (key == "c") then
-- cyl = ag.createCylinder(0.5, 1)
-- init(cyl)
elseif (key == "a") then
ccyl = ag.createCCylinder(0.5, 1)
init(ccyl)
elseif (key == "s") then
sphere = ag.createSphere(0.8)
init(sphere)
end
end