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 / Camera rotation around an object

Author
Message
pippo santa
18
Years of Service
User Offline
Joined: 9th Dec 2005
Location:
Posted: 15th Jan 2006 19:37
Hi,
I would like to write a code for the rotation of the camera around an object.(The camera must always follow the object).

I tried with this code but the camera moves strangely.

Any suggestions?

Attachments

Login to view attachments
Cookyzue
20
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 15th Jan 2006 20:06 Edited at: 15th Jan 2006 20:08
set camera to follow object position x(objnumber),object position y(objnumber),object position z(objnumber),object angle y(objnumber),distance behind object, height from object, smooth, collision

Smooth: 100 makes the camera follow smoothly 1 makes it follow instantly

Collision: i just leave this at 0 but its supposebly supposed to give the camera collsion

Hope thats what you need!


MCK Games
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 15th Jan 2006 21:08 Edited at: 15th Jan 2006 21:10
I've just made this little example You control a box around with the arrowkeys... And the camera will follow and turn with the player.

Here it is:


Since I don't know wethever you use DarkBasic Classic or DarkBasic Pro, I've made the code so it should be able to compile in both versions.

Hope that helps

And by the way, the source code button don't work... Use the code snippet method.

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
pippo santa
18
Years of Service
User Offline
Joined: 9th Dec 2005
Location:
Posted: 16th Jan 2006 14:47
Sorry, but I want to move the camera with the mouse
Shadowed Lightning
19
Years of Service
User Offline
Joined: 10th Nov 2004
Location:
Posted: 19th Jan 2006 04:56
Just a comment:
I noticed in your first post you didn't say that you wanted to move it with the mouse, and that may have been helpful to the people trying to help you.

And I'm not very good at coding, so I can't really help you... sorry.

AMD Athlon 64 3200 - GeForce 6800 GT - 320GB Hard Drive
1024MB RAM
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Jan 2006 11:48 Edited at: 19th Jan 2006 11:49
this any better?


@the nerd; in dbc (not tried in pro) if u move left too far it kept saying angle must be between 0 and 360.... but i did fix it (poorly)

life's one big game
pippo santa
18
Years of Service
User Offline
Joined: 9th Dec 2005
Location:
Posted: 19th Jan 2006 14:38
Thank you very much for the very quickly answer and excuse me for the mistake in the first post.
pippo santa
18
Years of Service
User Offline
Joined: 9th Dec 2005
Location:
Posted: 19th Jan 2006 14:41
I tried the code but i would like that the camera rotate around the object(the object must to remain in the same rotation angle)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 19th Jan 2006 15:13 Edited at: 19th Jan 2006 15:25
try this see if does what you might be thinking.



and as a function


I'm not getting you down am I, Ho Look! another fancy Door?
pippo santa
18
Years of Service
User Offline
Joined: 9th Dec 2005
Location:
Posted: 19th Jan 2006 18:27
Thank you very much HowDo. This code is perfect.

Login to post a reply

Server time is: 2024-09-24 13:30:59
Your offset time is: 2024-09-24 13:30:59