|
TOpenGl |
PROPERTIES |
Animation |
bool Animation
Set to true if you want to enable animation.
When true the component continuously invalidates its window, calling
each time the OnFrame event so your application can update the scene. Defaults
to false. |
Fps |
float Fps
Read only. Tells you the number of frame per second. Meaningful only
if animation is on. |
ProjectionOrtho |
bool ProjectionOrtho
Set to true if you want an orthogonal projection. Defaults to false. |
ProjectionWidth |
float ProjectionWidth
Only used when ProjectionOrtho is true. |
ProjectionHeight |
float ProjectionHeight
Only used when ProjectionOrtho is true. |
ProjectionNear |
float ProjectionNear
How far is the near plane from your eye. Objects nearer than this value
are clipped. |
ProjectionFar |
float ProjectionFar
How far is the far plane from your eye. Objects farthest than this
value are clipped. |
ProjectionAngle |
float ProjectionAngle
Set a value in degrees from 1 (sub millimeter telescope) to 180 (fish
eye). Only used when ProjectionOrtho is false. |
EyePosition |
T3DVector * EyePosition
Where is your eye.
Defaults:
EyePosition->X = 0;
EyePosition->Y = 0;
EyePosition->Z = -8; |
EyeTarget |
T3DVector * EyeTarget
Where are you looking to.
Defaults to 0,0,0. |
EyeUp |
T3DVector * EyeUp
If you are standing up and looking forward keep the default of 0,1,0. |
Parts |
TList * Parts
The list of TPart objects making up the scene. |
Lights |
TLuce * Lights[int n]
The 32 TLuce elements. |
ResourceContext |
int ResourceContext
Recast to HGLRC and play with the low level details of OpenGl. |
Textures |
TPicture * Textures[int n]
Assign up to MAXBITMAPS TPicture * objects.
Texture is currently disabled in this version. Conversion of TPictures
to texture buffer is implemented but too slow. I will enable it as soon
as I find some better solution to handle multiple textures. |
METHODS |
SaveTo |
bool SaveTo(String fileName)
Saves the current scene to a ".3DS" file. Returns true if OK. |
LoadFrom |
bool LoadFrom(String fileName)
Loads a scene from a file ".3DS". Returns true if OK. |
Refresh |
void __fastcall Refresh(TObject
*Sender)
Redraws the scene. |
AddGroup |
TPart * __fastcall AddGroup(TPart
* pParent, const char * name = 0)
Creates and adds to the scene a new a group. Returns the handle of
the new object.
If pParent is 0 or is not a group it is ignored. If it is a group the
new object is added to that group. The OnListChanged event is called. |
AddQuad |
TPart * __fastcall AddQuad(TPart
* pParent, const char * name = 0)
Creates and adds to the scene a quad that you can later modify into
any other shape. Returns the handle of the new object.
If pParent is 0 or is not a group it is ignored. If it is a group the
new object is added to that group. The OnListChanged event is called. |
AddCube |
TPart * __fastcall AddCube(TPart
* pParent, const char * name = 0)
Creates and adds to the scene a cube. Returns the handle of the new
object.
If pParent is 0 or is not a group it is ignored. If it is a group the
new object is added to that group. The OnListChanged event is called. |
AddSphere |
TPart * __fastcall AddSphere(TPart
* pParent, const char * name = 0)
Creates and adds to the scene a sphere. Returns the handle of the new
object.
If pParent is 0 or is not a group it is ignored. If it is a group the
new object is added to that group. The OnListChanged event is called. |
AddCylinder |
TPart * __fastcall AddCylinder(TPart
* pParent, const char * name = 0)
Creates and adds to the scene a cylinder. Returns the handle of the
new object.
If pParent is 0 or is not a group it is ignored. If it is a group the
new object is added to that group. The OnListChanged event is called. |
AddDisk |
TPart * __fastcall AddDisk(TPart
* pParent, const char * name = 0)
Creates and adds to the scene a disk. Returns the handle of the new
object.
If pParent is 0 or is not a group it is ignored. If it is a group the
new object is added to that group. The OnListChanged event is called. |
DeleteObject |
void __fastcall DeleteObject(TPart
*)
Remove from the scene and deletes an Object. The OnListChanged event
is called. |
Paste |
TPart * __fastcall Paste(TPart *
pParent, TPart * pp)
Adds to the scene an object you already have. The OnListChanged event
is called. Be careful to Clone any object that is already in the
list if you want to duplicate it using this function. |
EVENTS |
OnInitRC |
Called after initialization is completed. Trap it if you want to add
global settings like antialiasing, face culling or the like. |
OnListChanged |
Called when new objects are added or deleted from the Parts list. The
scene editor uses this to synchronize its objects TreeView with the content
of the TOpenGl component. |
OnPaint |
Called each time the windows is redrawn.
If you trap it you have to manually add objects to the scene (the
objects in the Parts list are not drawn). |
OnFrame |
Called just before the scene is going to be redrawn as the effect of
setting Animation to true. Trap if to modify the scene from one frame to
the other. |
OnSetProjection |
Called every time the scene is redrawn. Trap if to modify any OpenGl
state before the object list is drawn or OnPaint is called. |