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 / 3D game - how to make working camera?

Author
Message
Ca11um
14
Years of Service
User Offline
Joined: 3rd Jul 2010
Location:
Posted: 11th Jul 2010 17:12
I'm attempting to make a 3D game, but I cannot figure how to make the camera move left/right. I've used the default code for it to go forward/back (code below), but I don't know how to rotate the camera 1 or -1 without it actually rotating to the degree of 1 or -1 (for example, if you had the camera at 46 degrees, and pressed A, it would turn to 45 degrees).

Forward/back code:
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 11th Jul 2010 18:43
Rotate the camera 90 degrees to the direction you want to go, move forward, then rotate back, all before dbSync() is called.

Janks
14
Years of Service
User Offline
Joined: 3rd Jul 2010
Location:
Posted: 11th Jul 2010 20:34
If you are talking about strafing, which I think you are, it would look something like this:



Call it before dbSync() like jezza said.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 11th Jul 2010 20:35 Edited at: 11th Jul 2010 20:36
Don't know if I have added these two commands to 'DarkSDKCamera.h' in the past or if they are just there, but they work:



If you don't have them in the header file, just add this and you're fine.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.

Login to post a reply

Server time is: 2024-11-19 20:33:08
Your offset time is: 2024-11-19 20:33:08