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 / Synchronising floating cameras to a spaceship

Author
Message
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Aug 2003 00:28
Can someone please try out code and tell my how to sync the cameras position to an object. It is always one step out of sync because I think I read somewhere that when you tell an object to rotate it does not carried out until the 'sync' command. But then how to get camera moved at same time. I want my cameras to be as if they are stuck rock solid to the object and don't jiggle about.

P.S. This is the simplest code I could knock up to expalin my problem.



The programmer formerly known as sonic
diseased
22
Years of Service
User Offline
Joined: 16th Aug 2003
Location:
Posted: 28th Aug 2003 08:31
move the camera first, then move the ship in the same line.
use point camera instead of messing with all of those angles.

it took a little testing but i got it.. for some reason when u do something like this : if blah then move object: move camera it still causes jerkiness but if u do this..: if blah then move camera: move object then it sits still..
i posted the altered code too, except the camera is right behind the ship instead of a little above it, but u can probally fix that easy.
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Aug 2003 13:49
Can't test as I'm at work but you have confirmed something to me. What I think I need to do is at beginning of loop, position and rotate camera at same position as spaceship. If I roll left, then roll object AND camera at same time. Then move camera using relative movements to desired position. Will try this later!

The programmer formerly known as sonic
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 29th Aug 2003 03:28
WAHAY - FINALLY GOT IT SUSSED AND HAVE PROVED ONCE AND FOR ALL THAT FREE-FLIGHT COMMANDS ARE FIXED!!!!!!!!!!!!!!!

This demo will allow you to fly a spaceship using all the free-flight commands and also demonstrates how to use different camera angles properly.

Enjoy....



The programmer formerly known as sonic
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 29th Aug 2003 06:24
Were they ever unfixed? I thought the whole thing was people not understanding how 3d rotation worked. Huh. Well, that's one cool piece of code

--Mouse

Famous (Avatarless) Fighting Furball
dark puppus
22
Years of Service
User Offline
Joined: 16th Aug 2003
Location:
Posted: 29th Aug 2003 12:10
Very well. I ever thought a solution like this, but i was afraid that the camera do too work for positioning in x,y,z of the ship and then repositioning behind.

Then i never tried this solution. But now i see it working.

Thank you, very.
dark puppus
22
Years of Service
User Offline
Joined: 16th Aug 2003
Location:
Posted: 29th Aug 2003 19:38
oh, another question come to my head (my stupid head), with roll and pitch i can't return to a desired position of the ship.

Have you present rogue squadron ? the ship curve, but after you release the keys the ship reassume a horizontal position.
This problem seems not too easy, because the roll,pitch and turn rotation affects all angles of the ship.

More, the horizontal position mean : the ship have the line from a wing to another parallel to monitor width.

(i hope my english is not too bad)

Login to post a reply

Server time is: 2026-07-25 08:12:07
Your offset time is: 2026-07-25 08:12:07