Solved

Rotate camera with mouse motion

Posted on 2009-04-02
8
3,155 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
Comment
Question by:palehose
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 20

Accepted Solution

by:
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

by:InteractiveMind
ID: 24059565
0
 

Author Comment

by:palehose
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:palehose
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

by:palehose
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

by:palehose
ID: 24066290
Figured it out, thanks for the help.
0
 
LVL 20

Expert Comment

by:ikework
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

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

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

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

Join & Ask a Question