bugged thread, i see nothing, once again =/
EDIT ok thread is working
it's because auto cam is on, the box is actually in the place you want but the camera is shifted to face it, so all you need to do is to put dbAutoCamOff ( ) before your loop
also, this code is not perfect, while space is pressed, it will keep creating new boxes as long as the loop's alive, you press the space for like 0.5 sec, and since the app is 60 FPS (i suppose?), then you will create at least 30 boxes in one very fast space click, solution would be to do something like this:
bool bSpacePressed = false;
while (..)
{
if ( dbSpaceKey ( ) )
bSpacePRessed = true;
if ( !dbSpaceKey ( ) && bSpacePressed )
{
bSpacePressed = false;
//do whatever you want (e.g. create the box)
}
}
this will wait until the space key is pressed then released, then it will create the box