jdf / peasycam

Dead-simple mouse-driven camera for Processing
http://MrFeinberg.com/peasycam/
Apache License 2.0
116 stars 35 forks source link

Rotation finding shortest way #43

Open Devostated opened 2 years ago

Devostated commented 2 years ago

Hello, I wanted to have an axis gizmo to represent the camera angle, but I'm having huge problems, cause the rotation values don't use shortest way. Any idea how this could be fixed ?

    pushMatrix();
    translate(width/2, 50);
    scale(3);
    rotateX((cam.getRotations()[0])*-1);
    rotateY((cam.getRotations()[1])*-1);
    rotateZ((cam.getRotations()[2])*-1);
    shape(axis);
    popMatrix();

chrome_s3lw2GvFpW