function main () -- get the desired scene -- scene = Scenes.get("World") -------------------------------------- --- Loading & rendering the object --- -------------------------------------- -- load up sample shapes -- scene:import("samples/shapes/shapes.xsg") -- get the sphere from the resource system -- sphere = Resources.getTransform("Sphere"); -- make the sphere render in our scene -- scene:renderAdd(sphere) ------------------------ --- Creating a light --- ------------------------ -- create a point light -- light = Resources.newPointLight() -- a little behind the camera (5), but mostly to the right (20) -- light:position(20, 10, 5) -- really bright -- light:intensity(2) -- white light -- light:color(1, 1, 1) -- blue highlights -- light:specular(0, 0.4, 1) -- add the light to our scene -- scene:add(light) -- tell the scene to update our new light -- scene:update(light) ----------------------------------- --- Creating and using a camera --- ----------------------------------- -- create a perspective camera -- camera = Resources.newPerspectiveCamera() -- put it at 2, 2, and 1 unit off the ground -- camera:eye(2, 1, 2) -- now we need to actually 'give' the camera to the scene -- scene:add(camera) -- finally, trigger the use of the camera itself -- scene:trigger(camera) end