added ag::drawPoint()

git-svn-id: svn://anubis/anaglym/trunk@205 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop committed 2009-12-13 18:38:57 +00:00
1 parent cc608d7b83
commit bb76eb6e9b
6 files changed
+73

No files matched your search

+26
View File
@@ -7,9 +7,35 @@ function setupPins()
end
end
function setupStars()
stars = {}
local dist = 500
for i = 1, 1000 do
local star = {}
local rx = math.random() * math.pi * 2
local ry = (math.random() - 0.5) * math.pi
star.x = dist * math.cos(ry) * math.cos(rx)
star.y = dist * math.cos(ry) * math.sin(rx)
star.z = dist * math.sin(ry)
star.size = math.random(2, 8)
stars[i] = star
end
end
function drawStars()
for i = 1, #stars do
ag.drawPoint(stars[i].size, 1, 1, 1, stars[i].x, stars[i].y, stars[i].z)
end
end
function init_event()
pins = {}
lane = ag.loadModelStatic("bowling_lane")
setupPins()
setupStars()
ag.setCamera(0, -20, 5, 0, 20, 0)
end
function update_event()
drawStars()
end