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 Help

Author
Message
Knight mare
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: United States
Posted: 11th Feb 2004 21:08
I'm having trouble with my camera code. I need to have 3rd-person mouselook, but i cant get it to work with the controls i have. I used an example from the help files to get a smooth camera effect for the arrow keys, but i want to add side-strafing to the left and right arrows and have MouseX rotate the player object side to side. After that, i wanted to have MouseY rotate the camera up and down, but limit it's movement so it doesnt flip over. I've been trying to figure this out for almost a year now, and i cant do it lol.

I didnt include any of the attempts i made at making this code myself, because none of them worked.

Knight mare
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: United States
Posted: 11th Feb 2004 21:11
oh yeah i almost forgot...there's one more part of the code thats giving me trouble too. in the Update part, the POSITION OBJECT 1,X#,Y#,Z# command always puts the object at 0,0 coordinates, and i need it at 20,20 but every time i try and add a +20 to it, it messes up the camera controls.

GameKit
22
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 12th Feb 2004 01:38
I've got a simple way of doing it, but it may or may not work how you want it...

Position Camera Object Position X(1),Object Position Y(1),Object Position Z(1)
Turn Camera Left MouseMoveX()
Pitch Camera Down MouseMoveY()
Move Camera -15

That should work...but don't use it unless you are desperate, because in the long run it may be hard to add features to it like avoiding collisions...well... i hope i helped anyways...

Do not thwart the way of the dragon. For thou tasteth like chicken.
Knight mare
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: United States
Posted: 12th Feb 2004 12:01
Well, it definatley doesnt work how i wanted, but i think i may be able to get it to work, thanks.

Login to post a reply

Server time is: 2025-05-22 21:35:59
Your offset time is: 2025-05-22 21:35:59