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 that rotates around an object

Author
Message
ToyImp
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 10th Jan 2003 05:00
How can I get it so that the camera can rotate around an object. Rotating Up, down, left and right. I have been trying to figure this out for more than 2 days now. I have the object move by, pitch object up, and the like. Will I need to change this? If so then what do I need to change? Please respond asap. Thanks in adavance.
-------------
My avatar looks like he's constipated.
'I poop too much, then get tired. buuaaaaaaaahh' 'Here I sit, broken hearted. Wanting to poop. But only farted'
ToyImp
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 10th Jan 2003 07:07
Please, I need help on this. Been working on it for almost 3 days now. And its driving me NUcking Futs. THanks in advance for anyone that helps.

-------------
My avatar looks like he's constipated.
'Here I sit, broken hearted. Wanting to poop. But only farted'
Killer Sponge
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United Kingdom
Posted: 10th Jan 2003 14:00
so you want the camera to have an object as its centre and able to rotate round it. I'll have a fink and quick type and see what i can do it should be relativly easy!

K-Sponge

Killer Sponge
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United Kingdom
Posted: 10th Jan 2003 14:04
No code but heres an idea.
You know how you do the fixed camera on a 3rd person.
Do that but not on the object its self but on an invisable sphere in the same position of the object, and if you get the code and formula right as you rotate the sphere you should rotate the camera, thus lookng like you are rotating the camea round the object, this also means you can do varities of camera affect as well since the sphere is always the camera focus point you could do sweeping camera and shit with it.

Have a mess about and see what you can do.
I HAVE FAITH IN YOU
K-Sponge

ToyImp
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 10th Jan 2003 17:34


Dude, your a genius. I'll start working on it right away. Thank you so much.

-------------
My avatar looks like he's constipated.
'Here I sit, broken hearted. Wanting to poop. But only farted'
jsharbour
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location:
Posted: 10th Jan 2003 22:44
You want to use SIN and COS to rotate the camera around the object. Each time you move the camera, you want to point the camera at the object again (so it keeps looking at the object while it moves around in a circle). I don't have the code with me (at work), but there are many examples in the DarkBASIC book that use a rotating object in the scene. I'll grab the code later and post it here.

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 11th Jan 2003 01:25
Like this?



That is 2d rotation, 3d is harder but can be done, just ask if you want me to post it. Try not to post the same request in different boards.
ToyImp
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 11th Jan 2003 22:33
Well, seeing how I am doing a 3D game, the 3D Rotation would make sense.

-------------
My avatar looks like he's constipated.
'Here I sit, broken hearted. Wanting to poop. But only farted'
ToyImp
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 12th Jan 2003 02:00
I need something like this



But I need it to work with the keys, and not on its own. I've been messing with it again for at least 5 hours and still can't come up with anything.

-------------
My avatar looks like he's constipated.
'Here I sit, broken hearted. Wanting to poop. But only farted'
ToyImp
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 12th Jan 2003 02:04
I'm about to go nucking futs with the camera. I don't want to do anything else till I get it figured out. If anyone has any other ideas for doing a camera in a Combat Flight Sim, please let me know. I need to get this figured out.

-------------
My avatar looks like he's constipated.
'Here I sit, broken hearted. Wanting to poop. But only farted'
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 14th Jan 2003 00:13
3d rotation about a fixed point (which can be moved):



You'll want to put some constraints on that, I didn't bother.

My 3d space flight code:



This works on the same principle, just from a fixed (moveable) point looking outwards.

Login to post a reply

Server time is: 2024-04-23 19:24:31
Your offset time is: 2024-04-23 19:24:31