Guest User

Untitled

a guest
Apr 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. function scene()
  2.     s = Scene() { background_color = Color(.1, .1, .2),
  3.                   camera = Perspective(45) { transform = Translate(2*y) } }
  4.                  
  5.     s:add_entities({
  6.         Plane(),
  7.         --Sphere() { transform = Translate(y + 5*z) }
  8.     })
  9.    
  10.     s:add_lights({
  11.         Light() { color = white,
  12.                   transform = Translate(6*y - 3*x) }
  13.     })
  14.    
  15.     for i = 1,30 do
  16.         local v = Vector(3*math.cos(i/30*2*math.pi), 5 + 3*math.sin(i/30*2*math.pi), 15)
  17.         local tf = Translate(v) * Scale(.2, .2, .2)
  18.         s:add_entity(Sphere() { transform = tf })
  19.     end
  20.    
  21.     s:add_entity(Sphere() { transform = Translate(100*z) * Scale(20,20,20) })
  22.  
  23.     return s
  24. end
Add Comment
Please, Sign In to add comment