cameraToWorld() not returning expected value

cameraToWorld() is not returning what I would expect. Maybe something I am doing wrong.

Shouldn’t cam.cameraToWorld(ofVec3f(0,0,0) and cam.getPosition() return the same value ?

cam.setPosition(30, 0, 0);

cout << cam.getPosition() << endl;
cout << cam.cameraToWorld(ofVec3f(0,0,0) << endl;

output -->

30, 0, 0
16.7111, 0, -7.92078e-07

The camera coordinate origin should be at the world position of the camera i would think (?)… I tried using glm::vec3 types as well - same result.

Because it’s openframeworks the cameraToWorld is not what it seems to be.
This will give you Local Model Space, you need to invert VPmatrix to get to world space.
Classic openframeworks