I have a Terrain loaded and scaled Via the dbLoadTerrain() stuff.
its the terrain demo included with the dark SDK download with a few modifications as follows,
Mouse Movement
Mouse Movement -
// 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 );
Fps Display
// show the Current Fps
char szFPS [ 256 ] = "";
strcpy ( szFPS, "fps = " );
strcat ( szFPS, dbStr ( dbScreenFPS ( ) ) );
dbText ( dbScreenWidth ( ) - 20 - dbTextWidth ( szFPS ), dbScreenHeight ( ) - 40, szFPS );
And now my attempt at stopping the user running of the edge of the loaded terrain into the vastness of the skybox.
// Make sure we cant traverse off the land ala no clip mode!
if (dbCameraPositionX() >= dbGetTerrainXSize(1)){
dbPositionCamera(dbGetTerrainXSize(1), fHeight + 10.0f, dbCameraPositionZ());
}
if (dbCameraPositionZ() >= dbGetTerrainZSize(1)){
dbPositionCamera(dbCameraPositionX(), fHeight + 10.0f, dbGetTerrainZSize(1));
}
Everything works fine at least enough for now
the only issue is the code to block u running of the map seems really really erratic it does seem to work , but totally at random not at all confined to the edge of the map sometimes a small square in the center or a zig zag pattern across the map ;/
any suggestions this was the best i could come up with my very limited knowledge of DarkGDK, or c++ for that matter.
Stuck in the land of the confused! and loving it!