?
Solved

Rotating a 3-D model using the mouse

Posted on 2004-11-29
3
Medium Priority
?
406 Views
Last Modified: 2013-12-08
How would you enable the mouse to control the rotation and zoom of a model displayed in the window?
0
Comment
Question by:VWrestle97
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
info_expert earned 500 total points
ID: 12703315
Hi,

You should trap the mouse related messages and do your rotation tasks.
In directx, the specific messages constants are:

DIMOUSE_BUTTON0  
DIMOUSE_BUTTON1  
DIMOUSE_BUTTON2  
DIMOUSE_BUTTON3  
DIMOUSE_BUTTON4  
DIMOUSE_BUTTON5  
DIMOUSE_BUTTON6  
DIMOUSE_BUTTON7  
DIMOUSE_WHEEL
DIMOUSE_XAXIS  
DIMOUSE_YAXIS
DIMOUSE_XAXISAB
DIMOUSE_YAXISAB


Have a look at this tutorial on the topic (Even it was for directx 8 but you should be able to apply it):
http://www.andypike.com/tutorials/directx8/012.asp


Also study the DIACTION structure in Directx and msdn docs.

Hope this helps.
Regards

0
 

Author Comment

by:VWrestle97
ID: 12711298
do you know if OpenGL would be eaier?
0
 

Author Comment

by:VWrestle97
ID: 12712088
actually, I wanted to know how to rotate an object using the ball of the mouse.. not the default left or right rotation shown in the example.  And I am more interested in MANAGED code (DirectX 9), not C++ code.

thanks,

VWrestle97
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
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…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

862 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