Draggable3DOrientation Not working


#1

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;
    }   

#2

Anybody? I'd really appreciate the help...


#3

Hard to see what's going on there, but surely easy enough to debug it and see when the numbers change?

(And you should avoid using statics for things like that)


#4

Ok,  thanks. I'll try that