ofEasyCam with OSC


I am pretty new to 3d in openFrameworks! How would it be possible to change the view of ofEasyCam via OSC input instead of the MouseInput? Is it possible to get the exact same results that I get with MouseInput? I found some Information, but I actually dont really understand it.
Any Ideas/information on where to start to think/look into? Thank you!

Thats the code I would like to automate via OSC, not MouseInput:

            ofTranslate(-ofGetWidth()/2, -ofGetHeight()/2);

You can “change the view” moving the meshes or moving the camera. If you want to move the camera, I would use ofCamera instead of ofEasyCam, as it is not bounded to the mouse movement. If you want to move the mesh, you can proceed as you where doing. I would probably go for moving the camera.

An ofCamera class inherits from ofNode, therefore you can use boom, dolly, truck, tiltDeg, panDeg etc. to move and rotate the camera by a value that you can sent through OSC. You could event parenting a camera to an ofNode, that is, for example, the center of your scene, and let the camera rotate around that pivot. You can see an example about camera parenting and ofNode in example/3d/cameraParentingExample.

1 Like