OK here is the main program, Im not sure where im going wrong with it, id like to know.
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple 3D project that uses Dark GDK
// it can be used as a starting point in making your own 3D games
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// in this application we are going to create some 3D objects
// and position them on screen
// when starting a Dark GDK program it is useful to set global
// application properties, we begin by turning the sync rate on,
// this means we control when the screen is updated, we also set
// the maximum rate to 60 which means the maximum frame rate will
// be set at 60 frames per second
dbSyncOn ( );
dbSyncRate ( 120 );
dbSetDisplayMode ( 1024, 768, 32 );
dbSetWindowSize ( 1024, 768 );//sets window resoultion
dbSetWindowTitle ( "Adam's Game V1.0" );//gives our windowed app a cunning title
dbScreenType ( );
dbSetWindowOff ( );
// create our skybox
dbLoadObject ( "cloudcubetop.x", 200 ); // load the skybox model
dbSetObjectLight ( 200, 0 ); // turn lighting off
dbSetObjectTexture ( 200, 3, 1 ); // set texture properties
dbPositionObject ( 200, 1000, 2000, 4000 ); // position the skybox
dbScaleObject ( 200, 30000, 30000, 30000 ); // and finally scale
// set our random seed to a value from the timer, this will help
// to ensure each time we run our program the random values appear
// more random
dbRandomize ( dbTimer ( ) );
//LOAD IMAGE FROM PROJECT DIRECTORY - BMP FILE IS PLACED IN THERE - ASSIGNED IMAGE NUMBER 1 -
dbLoadImage ( "GRASS.bmp", 1 );
//CREATE MAP MATRIX, AND APPLY IMAGE NUMBER 1 TO THE MATRIX -
dbMakeMatrix ( 1, 1000, 1000, 100, 100 ); //makes a matrix 1000 by 1000, with 250 by 250 divisions.
dbPositionMatrix ( 1, -500, 0, -500); //this centralises the map and eases corodinates.
dbRandomizeMatrix ( 1, 2 ); //Sets the matrix to randomly change hight on its divisions. (hill effect)
dbSetMatrixTexture ( 1, 1, 1 );
dbPrepareMatrixTexture ( 1, 1, 1, 1 ); //Fills the divisions with our image 1.
dbUpdateMatrix (1);
dbScreenFPS ();
// make some 3D objects
for ( int i = 1; i < 50; i++ )
{
// make a box
dbMakeObjectBox( 1, 5, 10, 5 );
dbPositionObject ( 1, 0, 5, 0 );
dbMakeObjectBox ( 2, 1, 10, 1);
dbPositionObject ( 2, 10, 5, 0 );
dbMakeObjectBox ( 3, 1, 10, 1);
dbPositionObject ( 3, 20, 5, 0 );
dbMakeObjectBox ( 4, 1, 10, 1);
dbPositionObject ( 4, 30, 5, 0 );
dbMakeObjectBox ( 5, 1, 10, 1);
dbPositionObject ( 5, -10, 5, 0 );
dbMakeObjectBox ( 6, 1, 10, 1);
dbPositionObject ( 6, -20, 5, 0 );
dbMakeObjectBox ( 7, 1, 10, 1);
dbPositionObject ( 7, -30, 5, 0 );
dbMakeObjectBox ( 8, 1, 10, 1);
dbPositionObject ( 8, 0, 5, 10 );
dbMakeObjectBox ( 9, 1, 10, 1);
dbPositionObject ( 9, 0, 5, 10 );
dbMakeObjectBox ( 10, 1, 10, 1);
dbPositionObject ( 10, 0, 5, 20 );
dbMakeObjectBox ( 11, 1, 10, 1);
dbPositionObject ( 11, 0, 5, 30 );
dbMakeObjectBox ( 12, 1, 10, 1);
dbPositionObject ( 12, 0, 5, -30 );
dbColorObject ( 1, 16711680 );
dbSetObjectAmbient ( i, 0 );
dbSetObjectSpecularPower ( i, 255 );
}
// move our camera back so we can view the objects
dbPositionCamera ( 10, 10, -20 );
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
while ( LoopGDK ( ) )
{
// display some text on screen
dbText ( 0, 0, "Use Cursor UP, DOWN, key to move FWD and BACK," );
dbText ( 0, 15, "Mouse Aims." );
// move the camera forwards
if ( dbUpKey ( ) )
dbMoveCamera ( 1 );
// move the camera backwards
if ( dbDownKey ( ) )
dbMoveCamera ( -1 );
//mouse aim
dbRotateCamera(0, (dbCameraAngleX()+dbMouseMoveY()), (dbCameraAngleY()+dbMouseMoveX()), dbCameraAngleZ());
// here we make a call to update the contents of the screen
dbSync ( );
}
// before quitting delete our objects
for ( int i = 1; i < 50; i++ )
dbDeleteObject ( i );
// and now everything is ready to return back to Windows
return;
}
Thats the main program, its pretty simple so far.
and il include the skycube.x now, it looks not right... but thats me.
xof 0302txt 0064
Header {
1;
0;
1;
}
Material x3ds_mat_Material__8 {
0.545098, 0.192157, 0.517647, 1.000000;;
25.000000;
0.898039, 0.898039, 0.898039;;
0.000000, 0.000000, 0.000000;;
TextureFilename {
"cloudcube_top.jpg";
}
}
Material x3ds_mat_Material__3 {
0.266667, 0.192157, 0.545098, 1.000000;;
25.000000;
0.898039, 0.898039, 0.898039;;
0.000000, 0.000000, 0.000000;;
TextureFilename {
"cloudcube_left.jpg";
}
}
Material x3ds_mat_Material__1 {
1.000000, 1.000000, 1.000000, 1.000000;;
25.000000;
1.000000, 1.000000, 1.000000;;
0.000000, 0.000000, 0.000000;;
TextureFilename {
"cloudcube_right.jpg";
}
}
Material x3ds_mat_Material__7 {
0.192157, 0.474510, 0.545098, 1.000000;;
25.000000;
0.898039, 0.898039, 0.898039;;
0.000000, 0.000000, 0.000000;;
TextureFilename {
"cloudcube_back.jpg";
}
}
Material x3ds_mat_Material__2 {
0.200000, 0.552941, 0.176471, 1.000000;;
25.000000;
0.898039, 0.898039, 0.898039;;
0.000000, 0.000000, 0.000000;;
TextureFilename {
"cloudcube_front.jpg";
}
}
Frame x3ds_top {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.001000, 0.001000, 0.001000, 1.000000;;
}
Mesh top {
4;
-5.000000; 5.000000; -5.000000;,
5.000000; 5.000000; -5.000000;,
-5.000000; 5.000000; 5.000000;,
5.000000; 5.000000; 5.000000;;
2;
3;1,3,0;,
3;2,0,3;;
MeshMaterialList {
1;
1;
0;;
{x3ds_mat_Material__8}
}
MeshNormals {
6;
0.000000; -1.000000; 0.000000;,
0.000000; -1.000000; 0.000000;,
0.000000; -1.000000; 0.000000;,
0.000000; -1.000000; 0.000000;,
0.000000; -1.000000; 0.000000;,
0.000000; -1.000000; 0.000000;;
2;
3;0,1,2;,
3;3,4,5;;
}
MeshTextureCoords {
4;
0.999000;0.001000;,
0.001000;0.001000;,
0.999000;0.999000;,
0.001000;0.999000;;
}
}
}
Frame x3ds_left {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.001000, 0.001000, 0.001000, 1.000000;;
}
Mesh left {
4;
-5.000000; -5.000000; -5.000000;,
-5.000000; -5.000000; 5.000000;,
-5.000000; 5.000000; -5.000000;,
-5.000000; 5.000000; 5.000000;;
2;
3;0,2,1;,
3;3,1,2;;
MeshMaterialList {
1;
1;
0;;
{x3ds_mat_Material__3}
}
MeshNormals {
6;
1.000000; 0.000000; 0.000000;,
1.000000; 0.000000; 0.000000;,
1.000000; 0.000000; 0.000000;,
1.000000; 0.000000; 0.000000;,
1.000000; 0.000000; 0.000000;,
1.000000; 0.000000; 0.000000;;
2;
3;0,1,2;,
3;3,4,5;;
}
MeshTextureCoords {
4;
0.999000;0.001000;,
0.999000;0.999000;,
0.001000;0.001000;,
0.001000;0.999000;;
}
}
}
Frame x3ds_right {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.001000, 0.001000, 0.001000, 1.000000;;
}
Mesh right {
4;
5.000000; -5.000000; -5.000000;,
5.000000; -5.000000; 5.000000;,
5.000000; 5.000000; -5.000000;,
5.000000; 5.000000; 5.000000;;
2;
3;1,3,0;,
3;2,0,3;;
MeshMaterialList {
1;
1;
0;;
{x3ds_mat_Material__1}
}
MeshNormals {
6;
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;;
2;
3;0,1,2;,
3;3,4,5;;
}
MeshTextureCoords {
4;
0.001000;0.001000;,
0.001000;0.999000;,
0.999000;0.001000;,
0.999000;0.999000;;
}
}
}
Frame x3ds_back {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.001000, 0.001000, 0.001000, 1.000000;;
}
Mesh back {
4;
-5.000000; -5.000000; 5.000000;,
5.000000; -5.000000; 5.000000;,
-5.000000; 5.000000; 5.000000;,
5.000000; 5.000000; 5.000000;;
2;
3;0,2,1;,
3;3,1,2;;
MeshMaterialList {
1;
1;
0;;
{x3ds_mat_Material__7}
}
MeshNormals {
6;
0.000000; 0.000000; -1.000000;,
0.000000; 0.000000; -1.000000;,
0.000000; 0.000000; -1.000000;,
0.000000; 0.000000; -1.000000;,
0.000000; 0.000000; -1.000000;,
0.000000; 0.000000; -1.000000;;
2;
3;0,1,2;,
3;3,4,5;;
}
MeshTextureCoords {
4;
0.999000;0.999000;,
0.001000;0.999000;,
0.999000;0.001000;,
0.001000;0.001000;;
}
}
}
Frame x3ds_front {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.001000, 0.001000, 0.001000, 1.000000;;
}
Mesh front {
4;
-5.000000; -5.000000; -5.000000;,
5.000000; -5.000000; -5.000000;,
-5.000000; 5.000000; -5.000000;,
5.000000; 5.000000; -5.000000;;
2;
3;1,3,0;,
3;2,0,3;;
MeshMaterialList {
1;
1;
0;;
{x3ds_mat_Material__2}
}
MeshNormals {
6;
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000; 1.000000;;
2;
3;0,1,2;,
3;3,4,5;;
}
MeshTextureCoords {
4;
0.999000;0.001000;,
0.001000;0.001000;,
0.999000;0.999000;,
0.001000;0.999000;;
}
}
Frame x3ds_Omni01 {
}
}
AnimationSet x3ds_animset_0 {
Animation x3ds_anim_0 {
{x3ds_top}
AnimationKey {
0;
1;
0; 4; 1.000000, 0.000000, 0.000000, 0.000000;;;
}
AnimationKey {
2;
1;
0; 3; 0.000000, 0.000000, 0.000000;;;
}
}
Animation x3ds_anim_1 {
{x3ds_left}
AnimationKey {
0;
1;
0; 4; 1.000000, 0.000000, 0.000000, 0.000000;;;
}
AnimationKey {
2;
1;
0; 3; 0.000000, 0.000000, 0.000000;;;
}
}
Animation x3ds_anim_2 {
{x3ds_right}
AnimationKey {
0;
1;
0; 4; 1.000000, 0.000000, 0.000000, 0.000000;;;
}
AnimationKey {
2;
1;
0; 3; 0.000000, 0.000000, 0.000000;;;
}
}
Animation x3ds_anim_3 {
{x3ds_back}
AnimationKey {
0;
1;
0; 4; 1.000000, 0.000000, 0.000000, 0.000000;;;
}
AnimationKey {
2;
1;
0; 3; 0.000000, 0.000000, 0.000000;;;
}
}
Animation x3ds_anim_4 {
{x3ds_front}
AnimationKey {
0;
1;
0; 4; 1.000000, 0.000000, 0.000000, 0.000000;;;
}
AnimationKey {
2;
1;
0; 3; 0.000000, 0.000000, 0.000000;;;
}
}
}
Hopfully someone can make some sence of it.