Solved

# Rotate camera with mouse motion

Posted on 2009-04-02
3,144 Views
Last Modified: 2013-12-21
Here's what I'm trying to do:  on left mouse click, and motion of the mouse, rotate my camera.  Right right mouse click and movement, zoom in/out.  I'm completely lost.  I'm thinking I need to find the Euler angles for the rotation...?  Somehow get a rotation matrix?  Any help is appreciated.
0
Question by:palehose
• 5
• 2
8 Comments

LVL 20

Accepted Solution

ikework earned 500 total points
ID: 24057647
hi palehose,

this might help you, its a camera-class doing excactly that:

http://www.experts-exchange.com/Programming/Game/Game_Graphics/DirectX/Q_24274498.html

ike
0

LVL 25

Expert Comment

ID: 24059565
0

Author Comment

ID: 24065778
Hi ikework, thanks for the response.  I got the rotation working in my implementation, however it is extremely sensitive.  In other words, it rotates way too much with very little mouse movement.  How can I slow the rotation down a bit?
0

Author Comment

ID: 24065917
Also, one other question: how does your matrix::translate() function work?  I'm trying to figure out how to get the zoom in/out working in my implementation.  I have a translate function which takes a vector, what would the two values in m_pos be?  x and y?
0

Author Comment

ID: 24065980
Scratch the second question, I figured it out.  I was just confused at your vector implementation.  I'm still having trouble trying to slow down the rotation a bit, however.
0

Author Comment

ID: 24066290
Figured it out, thanks for the help.
0

LVL 20

Expert Comment

ID: 24066761
hi palehose,

great to hear that.. did you figure out all your above questions? if not, just tell me .. :)

ike
0

Author Comment

ID: 24067627
I did.  Everything works perfectly, thanks again.
0

## Join & Write a Comment Already a member? Login.

### Suggested Solutions

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

#### 707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!