Screen-to-world issue


I’m writing a class that uses ofCamera to alternate between the standard top-down view and an isometric orthographic view.

However, I’ve noticed that when I’m using the isometric view, the screenToWorld function in ofCamera gives a result that’s slightly inaccurate on some parts of the screen.

I’ve recorded a short video to illustrate what I mean. In the standard top-down view, screenToWorld works perfectly. In the isometric view, it’s only accurate in the centre of the screen. Incidentally, the purple plane in the video is the viewport.

Can anyone suggest a solution for this?



In case it’s relevant, here’s how I’m setting the isometric projection:

void ofxIsometricCamera::setCameraOrientation(const glm::quat & orientation)

To convert from screen space to world space, I’m simply using the function in ofCamera:

const glm::vec3 ofxIsometricCamera::screenToWorld(glm::vec3 xyz)
    return camera.screenToWorld(xyz);

Hi @davidspry, I am not sure if the regular orthographic mode complies with an isometric view, I think it does though.
Can you isolate the issue, whithout using your custom class? if you do, and the problem persists please open an issue in github and tag me there (same username as here), and include the code you used for testing.

1 Like

Thanks Roy. I’ve just opened an issue about it.