Well, I should came sooner, I beew working on this for almost 3 hours. Ok I will tell you where I am at. I have went over the code 100 time and got it to compile with out any errors. That is nice.
But it will not load a object or the cube that it should if no object is enter. I think the problem is in the string, it is not being givien to the loadobject (string) or the object will not load.
I loaded some object into the program by using code and I could see then fine.
but every thing works fine but for the loading and no errors.
here the code:
#include "DarkGDK.h"
char model[100];
// camera variables
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSync ( );
{
SetCurrentDirectory ( "C:\media" );
dbLoadImage ("Gus 1.jpg", 1 ) ;
dbPasteImage ( 1, 400, 0 );
dbSetTextSize(38);
dbSetTextFont("Arial");
dbText(0,10,"THE");
dbText(30,60,"GUS");
dbText(50,110,"WORKS");
dbSetTextSize(22);
dbText(10,250,"This viewer will take .X,.dbo and .3ds formatt" );
dbText(10,270,"You can move around in 3D space by using the arrow keys");
dbText(10,290,"The Gus Works supply all kinds of stuff to game maker.");
dbText(10,310,"contact: rennyhampton@thegusworks.com");
dbText(10,330,"Site address is www.thegusworks.com");
dbSync ( );
dbWaitKey ();
dbCLS ();
}
dbText(10,30," model name ( must be an .X or DBO like man.x or man.dbo):");
dbInput(),model;
if ((model, "") == 0)
{
dbMakeObjectCube (1,10);
}
else
{
dbLoadObject ("model",2);
}
//dbPositionObject (2,10,20,10);
//dbScaleObject (2,1000,1000,1000);
dbSetAmbientLight (100);
// move our camera back so we can view the objects
dbPositionCamera ( 10, 10, -20 );
dbCLS ();
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
while ( LoopGDK ( ) )
{
// move the camera using the arrow keys
dbControlCameraUsingArrowKeys ( 0, 5.0f, 0.3f );
// create a rotation axis based on mouse movement
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.4f );
// rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
dbSync ( );
}
// and now everything is ready to return back to Windows
return;
}
here I think is the problem code:
dbText(10,30," model name ( must be an .X or DBO like man.x or man.dbo):");
dbInput(),model;
if ((model, "") == 0)
{
dbMakeObjectCube (1,10);
}
else
{
dbLoadObject ("model",2);
}
I used the same loadobject to load the object. I just change it from :
dbLoadObject ("model",2);
to
dbLoadObject ("well1.dbo",2);
and it loaded ok.
I think it is in the string(model).
what would be the best wait to test it ,the model string? may be see if I can print it out.
Thanks I am going back to the work computer and work on it some more.
Thanks
renny