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 / FPS camera , problem strafing

Author
Message
cazub
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: here
Posted: 29th Jul 2008 13:59
Hi guys, i've been digging through every function i can think of with the c++ version of the Dark GDK and i can't figure out how to get a working FPS camera to move. I'm trying to simply duplicate movements like Quake. I can jump and my gravity works great BUT
My movements with the arrows (or WASD keys) don't have anything to do with where i'm looking. Its more like a dolly effect.
dbMoveCamera( 1) seems to do nothing.

My code for the strafing doesn't work either (for now i just rotate, move, then rotate back before i call the synch() ). What i get is a horrible flickering effect, looks like its trying to write the intermediate step to the screen before i call synch.
Also dbMoveCameraLeft , dbMoveCameraRight, up down, doesn't matter, i seem to get no result. The only thing that DOES work is the dbCameraPosition( float ,float , float) function. Can somebody give me the jist of how to get this to work? I'm ok with using sin() cos() on my x and z camera positions, i just dont' know how to go about doing it.

hey doods
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 29th Jul 2008 17:27
my FPS camera code:

see if that works for you. jsut shove it in the main loop, and you will alos need to create a variable speed, eg float speed = 0.1;
cazub
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: here
Posted: 29th Jul 2008 22:04
ok this works! I think before i would just rotate the camera 90 degrees, move foward 1, then rotate back 90 degrees which either flicker'd or didnt' work. I think because i didn't transform the x and z axis back to zero.
So thanks! Still havin trouble getting it to move foward, but now i changed
dbMoveCamera(1) to dbMoveCamera( speed) and its fine. So thanks!

hey doods
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 28th Sep 2008 03:24
I tried this and it still moved forward and back...

Login to post a reply

Server time is: 2024-09-30 07:20:37
Your offset time is: 2024-09-30 07:20:37