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 help

Author
Message
Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 23rd Dec 2006 02:34 Edited at: 23rd Dec 2006 02:38
I'm trying to make a 3rd person camera, in which the moving the x coordinate of the mouse moves the camera around the object. The problem i'm having so far is that the camera moves in a line instead of in a circle. I don't know how to explain this properly, so i'll try drawing it.



... and here's my code



P.S x#,y# and z# are just variables which represent the object position.

Thanks

EDIT: I forgot to mention that the blue line is the camera, the green circle is the object and the y should be a z.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Dec 2006 03:10
Theres code on my web site which does what you are after - if I understand you correctly. (Link in my sig).

Click on the Code Hints button and check out the various camera control examples.

TDK_Man

Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 23rd Dec 2006 05:35 Edited at: 23rd Dec 2006 05:36
Thanks TDK, i use your site as one of my main sources for learning DarkBASIC, but in this case i really want to build off my formula instead of changing it completely.

I made some progress, but there's still a problem, when the camera reaches the side of the object, the screen goes white. Here is my new code:



and also, since i'm <15, my maths knowledge isn't so great, so here's an explanation of how i got "zposcam=350^2-mousexv^2".

Login to post a reply

Server time is: 2024-11-26 05:25:24
Your offset time is: 2024-11-26 05:25:24