Well, I tried replacing the Y vector with -dbSin(xang), but that didn't work either...so I tried using dbPickScreen and dbGetPickVectorX-Z, and it works like a charm! I love you both. Here's a haiku dedicated to spatial gaming in dark GDK:
Flying between the
Planets earth and Moon for fun
you forum guys are great!
Anyways, here's the final, working code, if it's of use to anyone!
while ( LoopGDK ( ) )
{
dbSync ( );
dbPositionCamera ( x, y, z );
dbTurnCameraRight(dbMouseMoveX());
dbPitchCameraDown(dbMouseMoveY());
if(dbKeyState( 17 ))
{
dbPickScreen(400,300,1);
xvel += acceleration * dbGetPickVectorX();
yvel += acceleration * dbGetPickVectorY();
zvel += acceleration * dbGetPickVectorZ();
}
x+=xvel;y+=yvel;z+=zvel;
}
You can use this code for a newtonian physics based solar system simulator! Just load up models for earth, sun, and moon, initialize x,y,z,xvel,yvel,zvel, and acceleration to reasonable values, and start playing!