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.

Newcomers DBPro Corner / Camera problems

Author
Message
Sparda
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 31st Jan 2004 05:51
I want to have a camera follow an object (a jet) in a 3D field. I was using the following code to have the camera follow the jet, but I can only get the camera to be located under the jet. However, I would like the camera to be positioned over the top of the jet.
:

position camera object position x(plane),object position y(plane),object position z(plane)

set camera to object orientation plane
move camera -10

Obviously, repositioning the camera's ycoordinate doesn't corelate with the jet's real world coordinates. Also the lack of a "move camera up" command makes this more difficult. If anyone can give me some help or a code sample I would appreciate it, thanks.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 31st Jan 2004 08:20
look into the command SET CAMERA TO FOLLOW.
here's dbp help:

SET CAMERA TO FOLLOW
This command automatically controls the camera to provide a tracking system. By providing the 3D world
coordinate of the entity you wish to track, and some camera data, your camera will automatically update
its current position each time this command is called. The X, Y, Z and Angle values provide the coordinate
to track. The Distance value specifies the required distance between the coordinate and the camera. The
Height value specifies the required height of the camera in 3D space. The Smooth value specifies the level
of smoothing required for the camera, where a value of 1.0 is no smoothing and a value of 100.0 is lots of
smoothing. The Collision value is a special flag that allows the camera to detect whether it is hitting any of
the static collision boxes and if set to one will automatically adjust so as not to enter these collidable
areas.

SYNTAX
SET CAMERA TO FOLLOW X, Y, Z, Angle, Distance, Height, Smooth, Collision
SET CAMERA TO FOLLOW Camera Number, X, Y, Z, Angle, Distance, Height, Smooth, Collision

-RUST-
"What the... Mooooooooooo!"
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 31st Jan 2004 10:47


thats the function i use to follow an object.


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 2nd Feb 2004 18:19
Red_eye has given good code if you want to be in the X/Z plane. If, on the other hand, you want to use a spherical 3d system, take a look at the following link.

Its actually a small bug report about the "point camera" command but it'll also show you how to implement a spherical 3d camera system.

http://darkbasicpro.thegamecreators.com/?m=forum_view&t=24711&b=15

Cheers

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home

Login to post a reply

Server time is: 2024-09-21 18:24:52
Your offset time is: 2024-09-21 18:24:52