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 / Rotating object using mouse! NEDD HELP!!

Author
Message
GICO
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location: Probably watching The Monkey Show
Posted: 4th Sep 2004 19:32 Edited at: 4th Sep 2004 20:03
I am trying to make a game wich uses the 3rd person view. Right now you control the character (a cube) with the keyboard, but i cant make the chracter rotate using the mouse... it would be a great help if anyone could help me out!

Oh! By the way, I am using DBP

Thx in advance!

GICO

[EDIT] Darn! spelled "need" wrong.... oh well...[END_EDIT]
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 4th Sep 2004 21:19
I've attached a function I wrote that should do what you want, basically it just rotates the character and the camera around in a circle by the amount you move your mouse. You can fine tune the various parameters to make it suit your needs, I've commented the source code on how it works but if you need more help then just ask.


"Computers are useless they can only give you answers."
GICO
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location: Probably watching The Monkey Show
Posted: 5th Sep 2004 00:54
I tried your code... but i cant make it work the way I want in my game!!

This is what it looks like right now:


I rotate with the arrowkeys... but i want to rotate using the mouse....

GICO
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 5th Sep 2004 02:32
try this...
GICO
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location: Probably watching The Monkey Show
Posted: 5th Sep 2004 02:58
Whoa!!! Thx! It worked!!

Now i really can begin coding!!! Yeah!!

Thx again!

GICO

Login to post a reply

Server time is: 2024-11-27 08:34:53
Your offset time is: 2024-11-27 08:34:53