Creating a Simple Scene

  • Choose File | New | Application from the menu
  • Switch to the GLScene tab on the Component Palette
  • Drop down a TGLScene
  • Drop down a TGLSceneViewer
  • Set the Align property of TGLSceneViewer to alClient
  • Double click the TGLScene component to bring up the GLScene Editor.
  • Right click on the Camera's node and choose Add Camera
  • Select the GLSceneViewer and set it's camera property to your new camera.
  • Use the TGLScene component to bring back Scene Editor
  • Right click on Scene Object to bring up the menu.
  • Choose Add Object | Basic Geometry | Cube.
  • When you are done, the editor will look like this.
  • Use the Scene Object and its menus to add a light.
  • Now you need to light the scene and point the camera.
  • Select the camera.
  • Use the Object Inspector to Position the camera at coordinates 2, 2, 2.
  • Set the Target Object property of the camera to Cube1.
  • You should now be able to see the cube on your form.
  • Select the light in the Inspector and Position it at coordinates 2, 2, 1.
  • Run your program.