Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / error 6

Author
Message
qtuutr
13
Years of Service
User Offline
Joined: 30th Aug 2010
Location:
Posted: 30th Aug 2010 11:43
Oke, I'm trying to create a small game (who isn't) and therefore want a nice terrain. So I followed the terrain tutorial and tried to debug my program but it gave the very usefull error "6". I then tried adding dbSetTerrainTiling and Split but it didn't help. I copied the terrain code straight from the sample program but nothing there either. I also tried moving the files (terrain tutorial files) out of the "terrain" folder in my project but (surprisingly) that wasn't it either.
so, can someone explain what error "6" means? Down here is the code:

#include <cmath>
#include "DarkGDK.h"
#include "SC_Collision.h"

void setup_terrain(){
dbLoadImage("texture.jpg", 1);
dbLoadImage("detail.jpg", 2);
dbSetupTerrain();
dbMakeObjectTerrain(1);
dbSetTerrainHeightMap(1, "map.bmp");
dbSetTerrainScale(1, 3, 0.6f, 3);
dbSetTerrainLight(1, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.78f, 0.5f);
dbSetTerrainTexture(1, 1, 2);
dbSetTerrainSplit(1, 16);
dbSetTerrainTiling(1, 4);
dbBuildTerrain(1);

//// load images for the terrain
//dbLoadImage ( "terrain/texture.jpg", 1 ); // diffuse texture
//dbLoadImage ( "terrain/detail.jpg", 2 ); // detail texture
//
//// create the terrain
//dbSetupTerrain ( ); // set up terrain library
//dbMakeObjectTerrain ( 1 ); // make a new terrain
//dbSetTerrainHeightMap ( 1, "terrain/map.bmp" ); // set the terrain height map
//dbSetTerrainScale ( 1, 3, 0.6f, 3 ); // set the scale
//dbSetTerrainSplit ( 1, 16 ); // set the split value
//dbSetTerrainTiling ( 1, 4 ); // set the detail tiling
//dbSetTerrainLight ( 1, 1.0f, -0.25f, 0.0f, 1, 1, 0.78f, 0.5f ); // set the light
//dbSetTerrainTexture ( 1, 1, 2 ); // set the textures
//dbBuildTerrain ( 1 ); // build the terrain

dbLoadObject("terrain/skybox2.x", 2);
dbSetObjectLight(2, 0);
dbScaleObject(2, 3000, 3000, 3000);
}

void DarkGDK(){
SC_Start();
dbSetCameraRange(1.0f, 30000.0f);
setup_terrain();
while(LoopGDK()){

dbUpdateTerrain();
dbSync();
}

}
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 30th Aug 2010 20:47
I got that error when the image files were not found by the program. I don't know if anything else can cause it.

Check again if your image files are in the correct place. If you don't specify a path, then they should be located next to the cpp file if you are running from the debugger, and next to the executable if you are running the compiled program outside Visual Studio. You can also include dbFileExist commands to check if the program really sees the files.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 31st Aug 2010 00:19
Yeh, I think error 6 usually means it can't find the image for the heightmap or the heightmap is the wrong resolution.

Login to post a reply

Server time is: 2024-07-02 09:38:03
Your offset time is: 2024-07-02 09:38:03