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 / Small Camera Oddity

Author
Message
Shadow Fan 0
16
Years of Service
User Offline
Joined: 27th Jan 2008
Location: Livermore, CA
Posted: 16th Feb 2008 04:14
I found a nice bit of code for moving the camera in a strafing effect without too much pain so I'm using it:



It works fine generally. After some debugging I found that if the camera itself is turned left or right more than 90 degrees prior to checking dbRightKey(), the camera "flips upside down" until the key is released. The movement is still correct though so I'm thinking it's a weird issue with dbTurnCameraRight(). Any ideas or suggestions as to how to fix this viewing oddity? Obviously I don't want my player getting sick when they try to strafe to the side Thank you in advance!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Feb 2008 14:45
I do dthat all the time - THOUGH I USE the dbTurnCameraLeft(90) to set it back.

Make sure autocam off, and get rid of any dbControlCameraUsingArrowKeys or whatever it is.

Control the cam 100% yourself.

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 17th Feb 2008 17:46
May I suggest you change it into a function :

StrafeCamers( CamNumber, Change)

Then call this from your full camera / player motion function

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
Shadow Fan 0
16
Years of Service
User Offline
Joined: 27th Jan 2008
Location: Livermore, CA
Posted: 17th Feb 2008 22:39
I tried your suggestion Jason and oddly enough the camera now can get stuck upside down on occasion No worries though, thanks for the idea.

To Codger: I'll admit I'm not entirely sure what I'd put in your suggested function other than the code I already have (I'm fairly new to 3D programming). If I could see a rough pseudo-code layout of the function you have in mind that would be helpful. Take your time though, I have plenty of other aspects of the game to write and debug in the meantime
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Feb 2008 22:57
Ok - message not approved - but I saw it - and frankly - that sux it didn't work.

Can you post a short version of your program - just something to look at (a cube) with your camera controls - so someone can take a stab at catching the glitch and tweaking the code - then you can bring in the good changes that may come your way?

Shadow Fan 0
16
Years of Service
User Offline
Joined: 27th Jan 2008
Location: Livermore, CA
Posted: 18th Feb 2008 21:19
I'd be happy to provide that. Here's the function in the context of the basic cube you requested:



As you can see, there's not a lot to it. Camera goes forward with up, backwards with down, strafe with left/right, and you turn the view with the mouse. It's almost straight out of the Tutorial provided with Dark GDK labeled "Game Level." I hope that's helpful!

"...The Protoss do not run from their enemies. Aiur is our homeworld, it is here that we shall make our stand!" -Aldaris
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Feb 2008 22:25
How's This?


Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 18th Feb 2008 22:36 Edited at: 18th Feb 2008 22:37
I'd personally take the mathematical approach:



kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 19th Feb 2008 01:07
I'm with Benjamin on this.

Using MoveCamera only seems logical when you're making a "Simulator" game, like cars, airplanes, etc.
Shadow Fan 0
16
Years of Service
User Offline
Joined: 27th Jan 2008
Location: Livermore, CA
Posted: 19th Feb 2008 01:58
That bit of code and explanation worked perfectly Mr. Sage. Many thanks for your help and the others afterwards as well. I do like Benjamin's idea also as I am more familiar with Trig and have only recently become aquainted with Euler. If I have further problems I'll keep his idea in mind. Thanks again everyone!

"...The Protoss do not run from their enemies. Aiur is our homeworld, it is here that we shall make our stand!" -Aldaris

Login to post a reply

Server time is: 2024-10-08 11:41:36
Your offset time is: 2024-10-08 11:41:36