Rotating a 3-D model using the mouse

How would you enable the mouse to control the rotation and zoom of a model displayed in the window?
VWrestle97Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VWrestle97Author Commented:
do you know if OpenGL would be eaier?
0
VWrestle97Author Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.