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.

3 Dimensional Chat / ??? 3D Camera Help ???

Author
Message
McChief
22
Years of Service
User Offline
Joined: 24th Mar 2004
Location: USA
Posted: 2nd Sep 2004 17:21
I have been trying to program a flexible camera based off of the one that comes in the Advanced Terrain Pack. There are a couple of things I simply can't figure out, so after hours of reading, and testing, I thought I'd ask here. Here are a couple of things I can't make work... Please help!

1) How can I get the camera to "side step" left and right using the left and right arrow keys?

2) I figured that by removing the command "position camera camera position x( ), a# + 6, camera position z( )" that I can "zoom out", this works, but it will zoom out forever. How can you set a max level to zoom out? Say 50 units out and a minimum level of 6 units in?

3) I messed around with SET CAMERA FOV and SET CAMERA RANGE and also CAMERA ANGLE X and Y and I can't make it so the camera will stop at a 90 degree up and down view. In other words, how do I make it so the camera will only point straight down and straight up without going all the way around? I don't want my camera to see the landscape upside down...

Hope that makes sense, and any help would be appreciated! Thanks in advance.
walaber
22
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 2nd Sep 2004 19:48
for number 1:



for number 2, try some basic variable checking. keep track of the camera's position. for example:

if cameraz# > 500.0 then cameraz# = 500.0

this code will prevent the cameraz# variable from ever getting bigger than 500.0.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
McChief
22
Years of Service
User Offline
Joined: 24th Mar 2004
Location: USA
Posted: 3rd Sep 2004 03:17
Walaber,

Thanks a ton! The camera side stepping works great! I really appreciate your help on that. Now I just need to analyze your code to figure out WHY works.

Any idea on how to make the camera stop swiveling all the way around when I pan up and down? I'd like to have it stop panning up when its looking straight up into the sky and straight down into the ground.

Thanks again!
Maleck
22
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 14th Sep 2004 07:03
How are you aiming the camera up? What mathmatics are involved? I have a little app that pans the camera up and down, and i have it do a check of its angle before moving and does like the idstance example above and if it is maxed out, then don't increase any more, simply stay at the max value.

Login to post a reply

Server time is: 2026-07-08 00:06:24
Your offset time is: 2026-07-08 00:06:24