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 / Camera Motion problem

Author
Message
wickedly kick it
17
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th Aug 2007 20:15
i have a BAD problem where then i turn or pitch up the camera kinda makes a swivel along the radius of the object.


thanks a million for any help

102
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 21:04
Ahhh....

Your code does this:

1:Move Camera to where object WAS
2:Move Object to Where I Want It NOW
3raw Screen With Camera where object WAS <---- Wobble Likely here.

Make your code handle the object movement first - THEN - position the camera - THEN update the screen. You'll get that "Car on Rails" alignment you're likely looking for.

I run into this often - I'll make some code and the camera seems to be "lagged" - its because I got my order of things messed up.

Easy Fix! Good Luck.
Jason P Sage

wickedly kick it
17
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th Aug 2007 21:21
hm... i tried to do what you said but i think im doing it wrong.... do you mind maybe editing my above code in posting it so i can see waht you mean....
thanks a million!

102
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 21:39 Edited at: 9th Aug 2007 22:09
Try this - I didn't have a compiler handy though

[edit] Had to uncomment some lines I left commented..all fixed[/edit]


wickedly kick it
17
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th Aug 2007 21:52 Edited at: 9th Aug 2007 21:59
thanks that helped a bit, but im still having a problem but you reduced it... ill look more into it
EDIT: it works fine until it pitches up! Any idea why?

102
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 22:09
Um - I forgot to uncoment the camera code... <SORRY> Check the Cod enow... (gonna edit it)

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 22:10
If the commented thing did just fix it - I'd suspect the other keypresses besides the arrows. I didn't notice anything funny.

wickedly kick it
17
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th Aug 2007 22:37
hm that didnt fix it (i uncommented it before) but it ony does that when its pitched. and i cant get the rotate object command to work

102
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 22:40
does it act weird after you pitch up... like when you rotate it looks up then down as it spins...

Example: Look Up, then turh left and it doesn't spin level? Is that what you mean kinda?

wickedly kick it
17
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th Aug 2007 22:56
i cant explain it so here is the EXE the media is included in the zip file, extract it and use the < and > keys to accelerate/decelerate.

102

Attachments

Login to view attachments
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 23:12
Looks Cool

AHH - I know ......

Try this!

Adding to X,Y,Z is only good SOMETIMES. Once you turn the object ,
its not correct - because the Grid you did math on DID not turn.

By moving the camera versus trying to calc the correct x,y,z pos for the camera - I CHEAT - Let DBPro do the work See how I Moved the camera versus trying to "Offset it" with Plus 4 on X axis, +y on Y axis?

That should do it.




wickedly kick it
17
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th Aug 2007 23:27
THANK YOU SOOOO MUCH! you will get a mention in the credits.

102
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Aug 2007 23:28

Login to post a reply

Server time is: 2024-05-03 10:22:40
Your offset time is: 2024-05-03 10:22:40