GL Scripting Language Reference
GL String Commands:
The OPENGL control can have up to 1000 Materials defined, 1000 Palettes defined and 1000 Models defined. You can have an unlimited number of Scene Objects per control. Each Scene object requires 116 bytes of memory.
Note: Model Names are strings up to 8 characters long. Other Parameters are assumed floating point, unless & suffix which means an Integer (or Hexadecimal Number using &H prefix).
Before discussing the GL command set it is important to explain how a 3D scene world is defined as far as coordinates. The default coordinate system looks like this:
Scene 3D Cartesian Coordinate Plane
(-100,+100) (0,+100) (+100,+100)
|
| Z (-100)
Y /
| /
| /
(-100,0)------X--------(0,0)------X------(+100,0)
|
/|
/ Y
/ |
(+100) Z |
|
(-100,-100) (0,-100) (+100,-100)
What happens when your OPENGL control window is not perfectly square ?
The control uses the smaller of the two directions (vertical / horizontal) and defines that axis as being the default -100 to 100. The other direction (axis) will simply be larger than the default based on the ratio of the two. If the width (X axis) is twice the height of the control, then your x axis is effectively -200 to 200, instead of -100 to 100.
Now it should be noted that objects can exist outside this coordinate range, but they simply may not be visible. If you change the perspective then they may come into view.
The control assumes a value of 25 for perspective (depth perspective) when the visible range is -100 to 100. If the perspective is closer, then less will be in view. If the perspective is further away much more will come into view.
The control uses a Scripting language to define the 3D world and its objects. Scripts are sent to the control by simply sending a text string to the control. Multiple commands can be sent at one time by separating each command with a Carriage Return character (ascii 13) in the string. Commands are executed immediately.
Each 3D Object is references by an ID number from 1 to 1000000. No two objects can use the same ID number in a control. Each OPENGL control can have its own set of objects.
Each OPENGL control stores its own 3D Object List, so objects are specific to the OPENGL control they are created on.
Materials and Models are universal among all OPENGL controls. Models are referenced by names, while materials are referenced by ID numbers.
3D Reference Table:
--------------------------------------------------------------------------------------
3D Models - Universal to all OPENGL controls
Materials - Universal to all OPENGL controls
Palettes - Universal to all OPENGL controls
3D Objects - Unique to each OPENGL control
--------------------------------------------------------------------------------------
3D Models - Referenced by a Name (1 to 8 characters)
Materials - Referenced by ID # (0 to 999)
Palettes - Referenced by ID # (0 to 999)
3D Objects - Referenced by ID # (0 to 999)
--------------------------------------------------------------------------------------
The control automatically defines the first 200 materials for you (0 to 199) a builtin color pallete, but in different shades (ie. flat, semi-gloss, gloss), plus some texture maps.
You can see all the predefined materials here: GL Default Materials
Following topics explain all the different GL Commands in this scripting language. Each command is always a text string sent to the OPENGL control. Multiple commands can be sent at one time by putting all the commands in a single string separated by the CR (carriage return) which is ASCII 13. Use the SetText API (use wrapper in include file) to send a command to the control.
Some commands have parameters. If a parameter name ends with the & character this means it must be a valid 32 bit Integer value.