Solved

Rotate camera with mouse motion

Posted on 2009-04-02
8
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
Comment
Question by:palehose
  • 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
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now