Hi,
Here is a small demo (not optimised) developed using AmiDARK Engine Alpha R2.
It show the use of :
1. 3D Models
2. 3D Model as skybox
3. Ambien light
3. Camera controls
Here is a small shot :
[img]http://files.amidark-engine.com/AlphaR2_Demos/Model&Skybox.JPG[/img]
And the link to DL the demo :
http://files.amidark-engine.com/AlphaR2_Demos/Model&Skybox.lhaSource code to create this piece of 3D is not too long :
[code]#include "libAmiDARK.h"
float YAngle = 0.0f;
float XAngle = 0.0f;
float CamXPos, CamYPos, CamZPos;
void DarkLoop( void ){
// Create display.
DESetDisplayMode( 640, 480, 32 );
DESetWindowOff();
DESyncOn();
DESyncRate( 0 );
// Load the skybox and setup its display properties
DELoadObject( "Models/Skybox.adeo", 2 );
DEScaleObject( 2, 10000, 10000, 10000 );
// DeSetObjectEx4( Object, WireFrame, Transparent, Cull, Filter, Light, Fog, Ambient )
DESetObjectEx4( 2, 0, 0, 0, 1, 0, 0, 0 );
// Load the apache 3D model and setup its display properties
DELoadObject( "Models/Jet.adeo", 1 );
DEScaleObject( 1, 100000, 100000, 100000 );
DESetObjectEx4( 1, 0, 0, 0, 1, 1, 1, 1 );
// Create ambient light 0 for global lighting effects.
DESetAmbient( 75 );
DEColorLightEx( 0, 255, 224, 64 );
DESetAmbientColor( DERgb( 64, 32, 8 ) );
DESetDirectionalLight( 0, 1.0, -0.5, 1.0 );
// Position the default camera to see the apache model and the skybox
DEPositionCameraEx( 0, 0, 0, -512 );
DERotateCameraEx( 0, 0, 0, 0 );
DESetCameraRangeEx( 0, 1.0, 8192 );
// Apply some fog effects for better environment rendering.
DEFogColorEx( 192, 160, 32 );
DEFogDistance( 8000 );
DEFogStart( 500 );
DEFogDensity( 1 );
DEFogON();
// Run the demo and rotate the apache model.
while( !DELoop() ){
YAngle = DEWrapValue( YAngle + 0.25 );
XAngle = DEWrapValue( XAngle + 0.125 );
CamXPos = DECos( YAngle ) * 160;
CamYPos = DESin( XAngle ) * 128;
CamZPos = DESin( YAngle ) * 160;
DEPositionCamera( CamXPos, CamYPos, CamZPos );
DEPointCamera( 0.0, 0.0, 0.0 );
DESync();
}
}
Regards,
Freddix aka AmiDARK