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 / Moving the camera?

Author
Message
blargmob
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 18th Feb 2008 03:45
Howdy,

So far, I've been moving the camera around the terrain with dbMoveCamera. This works and all, but I want to move the camera like you would in an FPS game. So that no matter the angle of the terrain you're on, you still move the same distance. Whereas now, with dbMoveCamera, you move really fast on steeper terrain.

How can I achieve this?

"I used to have a handle on life, but it broke."
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th Feb 2008 02:20
Sounds like you are MOVING FIRST, then Adjusting to Ground Height. Is this So?

I'll presume so.

In my DBpro DrAft of Iron Infantry - the movement you describe would never do. I would basically use the ground height's in front of the tank and behind the tank (and ArcTanFull) to Get the "X-Pitch angle, then the same for the left/right (Roll Angle) and then I would orient the tank to these new found Angles 'To Hug the Terrain'... Now when I moved the tank - it wasn't moving FIRST then Adjusting to height - it was following the terrain.

therefore - Speed didn't WHIP while going up and down hills like you describe.

Now - You might be thinking - Yeah - dude but I'm making an FPS and I shouldn't have my head tilted back running up a hill!

You're right - Orient to Terrain, move, then Rotate your "cam eyes" to level at your new position.

Does this give you some ideas on how to approach this? If not - post again - and I'll try to bring code into the discussion a little.

Better Still - post a sample of your work - that demonstrates the issue that me and others can download and maybe play with and submit a fix or some ideas for ya!

blargmob
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 19th Feb 2008 03:08
Hmm, I will try the method of:

Orient to Terrain, move, then Rotate your "cam eyes" to level at your new position.

Only thing is, how do I find the angle between two points in the terrain? i.e. a point in front of the person and a point behind the person??

"I used to have a handle on life, but it broke."
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th Feb 2008 03:14 Edited at: 19th Feb 2008 03:15
Well - I have a rather large code snip for you - 99% you don't need admittedly - but I got to get back to what I'm coding - I'm in a frenzy of my own. But hunt for TanFull

That will get you to the part of the code I implemented the thing I mentioned to you. To help - note that I have an invisible Object I move around called the "objAngleFinder" - I Set it to my Position of Tank, orient to tak - move left a certain amount, get ground height - repeat for right - then front and back - - then I do the ArcTanFull thing - to get the angles .... See what you can make of this: IITank.dba

[edit]Hmm... I'll upload it. To big to post.[/edit]

Also - Note - the commoent at the VERY end - there is aweird bug in DBPro where it sometimes doesn't report the correct angle an object is at - and the workaround is there... funky - but it works

Attachments

Login to view attachments
blargmob
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 22nd Feb 2008 23:16
Is there just a formula that I can use to find this angle?

Also, It came to me that the method of: "Orient to Terrain, move, then Rotate your "cam eyes" to level at your new position." wouldn't work properly on a terrain. Is there any other way to move the camera correctly?

"I used to have a handle on life, but it broke."
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Feb 2008 03:02
1: I gave you code that does it

2: there is a little trick for that - and I can understand why you might be like ? HUH? There must be an Easier Way...

See if you can get it from this - its not so bad - objAngleFinder is simply an Object I have hidden all the time to do junk like this with:


Login to post a reply

Server time is: 2024-10-08 11:35:15
Your offset time is: 2024-10-08 11:35:15