I’m fairly new to Openframeworks and using anything other than SDL, so I was curious as to how I would go about setting up a camera that follows an object with an x and y position.
Is there something built into Openframeworks that I’m missing or would it require a bit of tinkering with OpenGL?
Here’s a sample bit of code I’m using to get the camera working, for those who might stumble upon this. View_width, etc would have to be defined by yourself, but you get the point.
ofEasyCam viewCamera; viewCamera.getTarget().setPosition((view_width*0.5)+view_xoffset,(view_height*0.5)+view_yoffset,0); viewCamera.setDistance(viewCamera.getImagePlaneDistance()); viewCamera.disableMouseInput();