|How To Setup Lights|
Supplemental Object Documentation
The Lights are one of the most crucial aspects of development, and responsible for the main look and feel of the graphical environment.
Disable the lights.
Enable the lights.
Load an individual light.
Move an individual light in any direction.
Render the lights.
Set the ambient color of a light.
Set the diffuse color of a light.
Set the look-at point of a light.
Move the plane surface in the direction of the specified light.
Set the material colors for a light.
Set the direction or normal of a surface plane.
Set the position point of a light.
Set the specular color of a light.
Render a shadow matrix.
Unload an individual light.
The position point of a light.
The camera relativity which binds a light.
The rotation factor of a light axes.
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
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.