How To Setup Lights E-mail
Supplemental Object Documentation

1. Overview

The Lights are one of the most crucial aspects of development, and responsible for the main look and feel of the graphical environment.

2. Methods

 Disable

Disable the lights.

 Enable

Enable the lights.

 Load <index>

Load an individual light.

 Move <index> <x> <y> <z>

Move an individual light in any direction.

 Render

Render the lights.

 SetAmbient <index> <red> <green> <blue>

Set the ambient color of a light.

 SetDiffuse <index> <red> <green> <blue>

Set the diffuse color of a light.

 SetDirection <index> <x> <y> <z>

Set the look-at point of a light.

 SetDistance <index> <distance>

Move the plane surface in the direction of the specified light.

 SetMaterial <index> <red> <green> <blue>

Set the material colors for a light.

 SetPlane <index> <x> <y> <z>

Set the direction or normal of a surface plane.

 SetPosition <index> <x> <y> <z>

Set the position point of a light.

 SetSpecular <index> <red> <green> <blue>

Set the specular color of a light.

 Shadow <index>

Render a shadow matrix.

 UnLoad <index>

Unload an individual light.

3. Properties

 Position <vertex>

The position point of a light.

 Relative <boolean>

The camera relativity which binds a light.

 Rotation <vertex>

The rotation factor of a light axes.

4. Example

The following example is based upon the engine being initialized at which point multiple lights are loaded, and also used to dynamically generate shadows of any objects projected on the surfaces of a map object.

' Game Basic 3D Engine Build 4096
' Copyright © Monarke Studios. All Rights Reserved.
 
Private Lights As New GameBasic3D.Lights
 
' Engine.Initialize
 
' Load and setup multiple Lights
Lights.Load 1
Lights.Load 2
Lights.Load 3
'
Lights.SetAmbient Index, Red, Green, Blue
Lights.SetDiffuse Index, Red, Green, Blue
Lights.SetSpecular Index, Red, Green, Blue
Lights.SetPosition Index, X, Y, Z
'
Do
 
    ' Engine.Begin
 
    Lights.Render
    Lights.Disable
 
        Map.Render
 
    Lights.Enable
    Lights.BeginShadow
 
        ' Setup shadow transformations
        Lights.Position = Object.Position
        Lights.Rotation = Object.Rotation
 
        ' Setup shadow surface planes
        Lights.SetDistance(Index, Map.Plane(...).Distance)
        Lights.SetPlane(Index, _
        Map.Plane(...).Normal.x, _
        Map.Plane(...).Normal.y, _
        Map.Plane(...).Normal.z)
 
        ' Render the shadow
        Object.Render
 
    Lights.EndShadow
 
    Object.Render
 
    ' Engine.Synchronize
 
Loop
 
Lights.Unload
 
' Engine.End
 
Set Lights = Nothing

5. Disclaimer 

Please note that the objects, and other various effects that can help extend the example are not entirely present but assume you're already familiar working with them. Please refer to the other online content, and technical reference included with the installation for further documentation.