0

I am trying to create a simple scene in 3d (in python) where you have a cube in front of you, and you are able to rotate it around with the mouse. I understand that you should rotate the complete scene to mimic camera movement but i can't figure out how you should do this. Just to clarify I want the camera (or scene) to move a bit like blender (the program).

Thanks in advance

  • 2
    I think what you wanted is called arcball rotation. It is quite easily searchable. If and when you have problems with implementation, then post your code. – keltar Feb 22 '18 at 07:59
  • Thank you for your answer although it was not completely what I was looking for, but i have found what I should do – Misunderstood Salad Feb 23 '18 at 16:29

1 Answers1

0

Ok I think i have found what you should do just for the people that have trouble with this like I did this is the way you should do it:

to rotate around a cube with the camera in opengl:

your x mouse value has to be added to the z rotator of your scene

and the cosinus of your y mouse value has to be added to the x rotator and then the sinus of your y mouse value has to be subtracted of your y rotator

that should do it