This is a very simple example which just creates a window and adds a rotator with which you can spin the scene around.


simple.lua screenshot

Source Code

-- Simple example
-- $Id: simple.lua,v 1.7 2002/06/24 07:06:31 trout Exp $

-- create a matrix
rotatemat = Matrix:new()

-- The callback function which renders our scene.
function renderScene()
  -- Clear the screen and depth buffer
  -- Tell the camera/eye what to look at
  gluLookAt(0,0,10, 0,0,0, 0,1,0)
  -- Draw the scene.

-- Create our window and specify a name and window rendering function
wmain = Window:create{
  title = "Doris: Simple example",
  render = renderScene -- specify the redraw function for this window

-- Put a sub window at the bottom of the screen
sw=SubWindow{ parent=wmain, side="bottom" }

-- Add an object rotator to the bottom of the screen that
-- manipulates the matrix we created.
        parent=sw, -- parent of this widget
        text="Rotate scene", -- text label for this widget
        value=rotatemat, -- matrix that rotator manipulates
        line="|", -- vertical spacing line drawn
        spin=0.99 -- allow the rotator to spin with little damping when released