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.

DarkBASIC Professional Discussion / Set Camera To Follow... angle parameter??

Author
Message
AndyUK
23
Years of Service
User Offline
Joined: 2nd Apr 2003
Location: United Kingdom
Posted: 5th Apr 2003 17:34
Does anyone use this command or have any detailed info on it? What axis does the angle parameter work on, or have i got it all wrong again? Im trying to get the camera to follow an object but it just aint working for me...
If anyone could explain the other parameter too i would be very greatfull.

thanx
| P4 2.4(533) | 512DDR(333) | GF4Ti4200 64MB | WinXP Home Sp1 | Cup of CoffeE |
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 5th Apr 2003 18:32 Edited at: 5th Apr 2003 18:36
Set Camera To Follow X, Y, Z, Angle, Distance, Height, Smooth, Collision

Angle = will position the camera around x,y,z (think of a circle).
Distance = how far behind the position (the radius of the circle).
Height = height above ground.
Smooth = applies a form of damping effect when the camera moves, 0 = no smoothing.
Collision = "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." - I've never used this effectivly to be honest.


This is one of my little test programs. Feel free to pick it apart.



Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 5th Apr 2003 18:35
The angle parameter works on the Y axis of the target object.

Here is a small code sample:



Current Project: Retro Compo. Entry.
AndyUK
23
Years of Service
User Offline
Joined: 2nd Apr 2003
Location: United Kingdom
Posted: 5th Apr 2003 18:35
Thanx [b]) just working on it now

| P4 2.4(533) | 512DDR(333) | GF4Ti4200 64MB | WinXP Home Sp1 | Cup of CoffeE |
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 5th Apr 2003 18:41
^^ Whoops - Your post wasn't there when I posted my reply Easily Confused.

Height = Absolute Height of Camera in seen

Sooth = A value between 0 and 100. With a value of 0, the camera is very rigid and sticks right behind the object at the precise angle. With a value of 100, the camera is best described as lazy - Ie. Rotate the object and the camera will gently swing round to line up with it.

Collision is best done using AUTOMATIC CAMERA COLLISION(radius,response) where response = 1 means that the camera backtracks if a collision occurs. Unfortunately DBP doesn't really have very extensive collision commands, so in order to do camera collision without using ACC() you have to create a small, invisible object which is placed in the same place as the camera itself.

Current Project: Retro Compo. Entry.
AndyUK
23
Years of Service
User Offline
Joined: 2nd Apr 2003
Location: United Kingdom
Posted: 5th Apr 2003 18:51 Edited at: 5th Apr 2003 18:51
which is what im going to do hehe... just tried the above code and it works lovely.. cant believe how smooth the camera pan is in exclusive mode.. BUT.. i realized its not what i was looking for.. i thought i could use the command to make my first person view but i think this is more taylored to 3rd person tracking?..

| P4 2.4(533) | 512DDR(333) | GF4Ti4200 64MB | WinXP Home Sp1 | Cup of CoffeE |
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 5th Apr 2003 19:21 Edited at: 5th Apr 2003 19:25
Yes, this is only really for third person use.

I think that you are looking for POINT CAMERA X,Y,Z to aim the camera at another object.

However, this provides no smoothing, so you need to use the CURVEVALUE command to slowly "bend" the value to the target. However this requires trig maths to work out the angle to the object from the camera, although you can point it at the object, then restore its original position, then curve the values and get an interpolated position.

Current Project: Retro Compo. Entry.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 5th Apr 2003 19:26
One other thing, AUTOMATIC CAMERA COLLISION does work well for 1st person games.

Current Project: Retro Compo. Entry.
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 5th Apr 2003 19:34
to use this for 1st person :
Create Object that represents the xyz position of the 1st person
use the camera to follow the 1st person object
hide object prior to sync

Login to post a reply

Server time is: 2026-07-10 12:49:33
Your offset time is: 2026-07-10 12:49:33