I just started using Dark GDK, and I am making a racing game to get it all started. So I was wondering, how can I make my model conform to the terrain so that it climbs slopes instead of pointing into them....heres my game loop so far
dbTurnObjectRight(10,180);
if (dbUpKey()) {
if (fSpeed<fSpMax)
fSpeed+=fAccel;
}
else if (dbDownKey()) {
if (fSpeed>fSpMax*-0.5)
fSpeed-=fAccel;
}
dbMoveObject(10,fSpeed);
if (fSpeed>0) fSpeed-=fFriction;
else if (fSpeed<0) fSpeed+=fFriction;
if (dbLeftKey())
dbTurnObjectLeft(10,2);
else if (dbRightKey())
dbTurnObjectRight(10,2);
float fHeight = dbGetTerrainGroundHeight (1,dbObjectPositionX (10),dbObjectPositionZ (10));
dbPositionObject (10,dbObjectPositionX (10), fHeight, dbObjectPositionZ (10));
dbPositionCamera ( dbObjectPositionX (10), fHeight + 5.0f, dbObjectPositionZ (10));
dbSetCameraToObjectOrientation(10);
dbMoveCamera(-5.0f);
dbTurnObjectRight(10,180);
dbUpdateTerrain ( );
dbSync ( );