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.

Newcomers DBPro Corner / Need Help with 3rd Person Camera Rotation.

Author
Message
Kansas
18
Years of Service
User Offline
Joined: 6th Jan 2006
Location: Kent, UK.
Posted: 7th Jan 2006 16:32
Hey, Im having a problem with the camera of a cube in 3rd Person. As you can see in the code I have changed the variable of X to +5 so that the distance of the camera behind the cube is increased. The only probelm with this is that when the cube rotates (using the arrow Keys) the camera rotates faster, which means it looses the cube in sight. Is there any way to make sure the camera moves the same speed as the cube when rotating from left to right? I think it may have something to do with the speed variable bject_Speed#. Is there a way to linking that variable to the camera so it has the same speed as the cube?

Thanks
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 8th Jan 2006 10:26 Edited at: 8th Jan 2006 10:28
Hi there.

I can't see your code... Please use the code tags..


But I've just wrote this little code for you with camera rotation behind a player, it should work. Control the player using arrowkeys.



Hope that works

That code will not work in DarkBasic Classic. If you have classic I can convert the code for you

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
Kansas
18
Years of Service
User Offline
Joined: 6th Jan 2006
Location: Kent, UK.
Posted: 8th Jan 2006 14:52
Thanks alot.
I posted the code in the 'code box' instead of using tags, was my first time posting code.
The thing I was having trouble with is the camera when it rotates,
The part of the code which reads:



I changed the object position z (1) to :


So that the camera is further behind the object, so that i can see the whole cube. But when I rotate the cube and move in a different direction, the camera looses sight of it. Do you know what I need to change so that it will 'track' the cube and stay in the same position behind it like it did before i changed the value?

I hope this makes sense

Thanks.

Login to post a reply

Server time is: 2024-09-24 13:26:26
Your offset time is: 2024-09-24 13:26:26