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 a model according to mouse position

Author
Message
Dr BOK
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 21st May 2003 22:24 Edited at: 21st May 2003 22:25
I was determined not to come to the message board but to figure it out myself and I came up with what I thought was a solution. This was not the case however so I need your help. I am trying to achieve mouse controlled aiming in a 3rd person view, like Max Payne for example. I wrote up some code but it seems to have no effect. I had a look at the face demo but I was wondering if someone could explain it a bit further maybe making it slightly easier to understand i.e the code is in one place. My code is attatched. I used the room demo guy as I had no model lying around. Thanks.

Flawless Designs
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st May 2003 22:56
I don't quite understand what you are trying to achieve, but I can fix the 'no effect' problem you have.

Just put the 3 lines that get the mouse position, and move them to immediately after the 'do' command.
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 21st May 2003 23:15
If I understand you, you are trying to make a mouse-controlled 1st person camera, am I right? This code should work for you:



Not really much to explain here, moving the mouse increased or decreases the value of yAngle# and xAngle#, which determine where the camera is facing.

Whatever I did I didn't do it!
Dr BOK
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 22nd May 2003 15:35
Yea you're nearly right Kentaree. Although its 3rd person with a mouse controlled camera I dont think it matters. IanM I also appreciate your input thanks for both your suggestions.

Flawless Designs

Login to post a reply

Server time is: 2024-09-20 09:43:54
Your offset time is: 2024-09-20 09:43:54