I have a static Draggable3DOrientation object and set the viewport to the local bounds of the current window. I want to update the viewMatrix as you do in the OpenGLDemo, but calling PhOrientation::draggableOrientation.getRotationMatrix() has no effect. Changing the rotation argument does rotate the vertices, however. Any idea why this is not working? I don't think that the draggableOrientation is getting triggered. Could it be that the viewPort is not being properly set? I'm on OSX Maverick.
void OpenGLCanvas::resized() { PhOrientation::draggableOrientation.setViewport (getLocalBounds()); } void OpenGLCanvas::mouseDown (const MouseEvent& e) { PhOrientation::draggableOrientation.mouseDown (e.getPosition()); } void OpenGLCanvas::mouseDrag (const MouseEvent& e) { PhOrientation::draggableOrientation.mouseDrag (e.getPosition()); } //elsewhere I call this: static Matrix3D<float> getViewMatrix( float rotation) { Matrix3D<float> viewMatrix (Vector3D<float> (1.0f, 1.0f, -10.0f)); viewMatrix *= PhOrientation::draggableOrientation.getRotationMatrix(); Matrix3D<float> rotationMatrix = viewMatrix.rotated (Vector3D<float> (rotation, rotation, 3.30f)); return viewMatrix * rotationMatrix; }