How can I rotate 3-D an object with through mouse by using OpenGL?How can I do that?Could you show me how this is done?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s a lot of code to do that and it also depends on how you’re rendering the object.
Are you using the fixed function pipeline or are you using shaders?
As for the mouse part, you need to handle the MouseDown, MouseMove and MouseUp methods / events the form generates. Try getting a feel for how the mouse works by just drawing a simple bitmap that can be moved using the mouse. Once you’ve got the hang of handling the mouse input, change the response to update the object’s rotation based on the amount the mouse moved in the x/y/z axes. Try to avoid using Euler (angle) notation for the rotation of the object, use a matrix and rotate the matrix instead.