Ive created a model in 3dsmax 9. I textured this within 3dsmax and exported it as an .x model. But it is not showing all my textures. In 3ds there are 2 layers of textures but when Exported, there isnt! I can do it manually, although I need to split it up as in make object from limbs (which doesnt even work properly).
How do I fix this little issue
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
#include <GlobStruct.h>
// the main entry point for the application is this function
void camera ( void );
void terrain ( void );
void gravity (int cam_h);
void player_input ( void );
void create_player ( void );
void show_town_a( void );
float cam_y = 0;
int g_fSpeed = 250; // speed at which camera moves
int g_fTurn = 5; // turn speed for mouse look
float g_fOldCamAngleX = 0.0f; // to store original x angle
float g_fOldCamAngleY = 0.0f; // to store original y angle
float g_fCameraAngleX = 0.0f; // to sotre new x angle
float g_fCameraAngleY = 0.0f; // to store new y angle
void showFPS ( void ); // show frame rate
// forward declaration for functions
void userInput ( void );
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncRate ( 60 ); // set sync rate to 60
// switch backdrop off - no need to clear screen
dbSyncOn ( );
dbFastSync();
int cam_h = 100;
dbSetDisplayMode(1200,850,32);
dbMaximizeWindow();
terrain();
camera();
create_player();
show_town_a();
dbPositionCamera(4600310,9000,4458920);
while ( LoopGDK ( ) )
{
// update the screen
if (dbControlKey()){
float fHeight = dbGetTerrainGroundHeight(1, dbCameraPositionX(), dbCameraPositionZ());
dbPositionCamera(dbCameraPositionX(), cam_y, dbCameraPositionZ());
dbPointCamera(dbCameraPositionX(),0,dbCameraPositionZ());
cam_y = cam_y + 12500;
}else{
userInput();
cam_y = dbCameraPositionY(4);
}
dbSetCursor(0, 0);
for (int i = 0; i < g_pGlob->checklistqty; ++i)
{
dbPrint(g_pGlob->checklist[i].string);
}
//dbText(10,10, dbStr(dbObjectPositionX(1)));
showFPS(); // show frame rate
dbUpdateTerrain();
dbSync ( );
}
// return back to windows
return;
}
void camera ( void )
{
dbMakeCamera(4);
dbSetCurrentCamera(4);
dbSetCameraRange(4,1,50000000000000);
}
void terrain ( void )
{
dbSetupTerrain();
dbMakeObjectTerrain(1);
dbSetTerrainHeightMap(1,"Terrain\\map_a.jpg");
dbLoadImage("Terrain\\detail\\map_detail.jpg",3);
dbLoadImage("Terrain\\map_a_tex.jpg",2);
dbSetTerrainScale(1,15000,2000,15000);
dbSetTerrainSplit(1,16);
dbSetTerrainTexture(1,2,3);
dbSetTerrainTiling(1,1);
dbBuildTerrain(1);
//dbLoadObject ( "SkyMap\\skybox2.x", 5 ); // load the skybox model
//dbSetObjectLight ( 5, 0 ); // turn lighting off
//dbSetObjectTexture ( 5, 3, 1 ); // set texture properties
//dbPositionObject ( 5, 1000, 2000, 4000 ); // position the skybox
//dbScaleObject ( 5, 300000, 300000, 300000 );
}
void gravity (int cam_h)
{
float fHeight = dbGetTerrainGroundHeight(1, dbCameraPositionX(), dbCameraPositionZ());
dbPositionCamera(dbCameraPositionX(), fHeight + cam_h, dbCameraPositionZ());
}
void player_input ( void )
{
}
void create_player ( void )
{
}
void show_town_a (void)
{
dbLoadObject("City\\NewLondon.x",6);
float fHeight = dbGetTerrainGroundHeight(1,4600310,4458920);
dbScaleObject(6,3000,3000,3000);
dbSetObjectCull(6,1);
dbLoadImage("City\\wall_a.jpg",7);
dbMakeObjectCube(12,50);
dbPositionObject(6,4600310, fHeight,4458920);
dbPerformCheckListForObjectLimbs(6);
dbMakeObjectFromLimb(8,6,20);
dbSetBumpMappingOn(8,7);
}
void userInput ( void )
{
dbControlCameraUsingArrowKeys ( 4, g_fSpeed, g_fTurn );
//dbPositionObject(5,dbCameraPositionX(), dbCameraPositionY() + 2000, dbCameraPositionZ());
g_fOldCamAngleY = g_fCameraAngleY;
g_fOldCamAngleX = g_fCameraAngleX;
g_fCameraAngleY = dbWrapValue ( g_fCameraAngleY + dbMouseMoveX ( ) * 0.4f );
g_fCameraAngleX = dbWrapValue ( g_fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
dbYRotateCamera ( dbCurveAngle ( g_fCameraAngleY, g_fOldCamAngleY, 24 ) );
dbXRotateCamera ( dbCurveAngle ( g_fCameraAngleX, g_fOldCamAngleX, 24 ) );
char* szKey = dbInKey ( );
if ( strcmp ( szKey, "+" ) == 0 )
{
if ( g_fSpeed < 20000 )
g_fSpeed = g_fSpeed + 250;
}
if ( strcmp ( szKey, "-" ) == 0 )
{
if ( g_fSpeed > 250 )
g_fSpeed = g_fSpeed - 250;
}
float fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ) );
dbPositionCamera ( dbCameraPositionX ( ), fHeight + 50, dbCameraPositionZ ( ) );
dbPositionObject(12,dbCameraPositionX(),fHeight,dbCameraPositionZ());
}
void showFPS ( void )
{
char szFPS [ 256 ] = "";
strcpy ( szFPS, "fps = " );
strcat ( szFPS, dbStr ( dbScreenFPS ( ) ) );
dbText ( dbScreenWidth ( ) - 300 - dbTextWidth ( szFPS ), 20, szFPS );
strcpy ( szFPS, "X = " );
strcat ( szFPS, dbStr ( dbCameraPositionX ( 4 ) ) );
dbText ( dbScreenWidth ( ) - 300 - dbTextWidth ( szFPS ), 30, szFPS );
strcpy ( szFPS, "Z = " );
strcat ( szFPS, dbStr ( dbCameraPositionZ ( 4 ) ) );
dbText ( dbScreenWidth ( ) - 300 - dbTextWidth ( szFPS ), 40, szFPS );
}