限制四元数间距

时间:2016-04-02 03:35:39

标签: java opengl angle quaternions pitch

我想将相机的音高限制在+/- 90度。我该怎么做。

public boolean mouseMoved(MouseEvent event) {
    Quaternion.mul(rotation, new Quaternion((float) Math.toRadians(event.x / -1f), Vector4f.UP), rotation);
    Quaternion.mul(rotation, new Quaternion((float) Math.toRadians(event.y / 1f), rotation.getRight(null)), temp);


    updateMatrix();
    return true;
}

0 个答案:

没有答案