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 Discussion / Camera Problems

Author
Message
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 14th Jun 2005 10:23
I've tried many things, but how do I make the camera follow the object right behind it?

Enjoy Life while your still alive.
Enjoy a recees anytime!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 14th Jun 2005 12:08
I kinda... thought... some one would be able to help me with the camera following a moving object...

Enjoy Life while your still alive.
Enjoy a recees anytime!
the fake Mr T
19
Years of Service
User Offline
Joined: 6th Jun 2005
Location:
Posted: 14th Jun 2005 18:43
you mean using the command to make the camera follow a set location
or can this be done anyway i choose?

because if you use
`position camera objectsxpos,objectsypos,objectzpos - 200`
in your main loop or where ever, so long as this and the objects x,y & z positions are updated reguarly this will work
the fake Mr T
19
Years of Service
User Offline
Joined: 6th Jun 2005
Location:
Posted: 14th Jun 2005 18:49
i've just realised that won't work if the object turns and you want the camera to still be `behind` the object, however this could be done through the turn camera left/right command as well as the position camera command, but you would need to have two instances - one for turning left and one for turning right.
i have never had to do this before so sorry i can't be more specific.
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 14th Jun 2005 23:32 Edited at: 14th Jun 2005 23:33


that should make the camera follow behind your object. but my db application has self destructed so i can't test it out.

Your Head A-Splode
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 15th Jun 2005 00:13
I filled all the # signs with the object number.
The camera goes behind the object, but doesn't follow it
Thanks for trying everyone.

Enjoy Life while your still alive.
Enjoy a recees anytime!
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 15th Jun 2005 00:28
In the help file look for "set camera to follow" or something like that.

The happenings of tommorow are behind us now
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 15th Jun 2005 00:35 Edited at: 15th Jun 2005 00:52
I have no clue to do what the heck you just told me too do...

Any other way?

EDIT: YAY! I looked at the example of the camera follow command and I stole the camera coding off of it nd now it works!


Thanks everyone!

I'm putting the coding in the Code Snippets section so everyone can learn how!

Enjoy Life while your still alive.
Enjoy a recees anytime!
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Jun 2005 08:48 Edited at: 15th Jun 2005 08:49
GreenFox,

Below is a code snippet in where I have used the cos and sin maths to make the camera follow behind the object. Also, I have used the point camera command to make the camera always look at the object. In the program below, which is fully executable, the user is enabled to use the arrow keys to rotate and move the cube character, and also use keys w and a to increase/decrease the distance between the cube character and the camera.

Using sin and cos, there is not much I can explain, the reason being that I, myself, never learned such maths in school. However, I have put forth much experimentation in the past to learn how to gain some useful control over the commands. These maths are essentially how the [/i]new position(newpositionx();newpositionz(),newpositiony() commands function. In the case of my lack of knowledge, you will just need to study over the source code yourself, and run some of your own experiments.




+NanoBrain+
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 15th Jun 2005 12:44 Edited at: 15th Jun 2005 12:45
Quote: "
The camera goes behind the object, but doesn't follow it
"


what do you mean it doesn't follow it? isn't going behind the object following it? exactly what is the problem? but anyways it's good that you got something to work for you.

Your Head A-Splode

Login to post a reply

Server time is: 2025-05-22 21:46:23
Your offset time is: 2025-05-22 21:46:23