curving motion of camera / line


Does someone knows how to get:

  • this nice moving camera motion using i.e. ofxCamera?
  • the curves of the thick blue line in

in this video:



I used ofxCamera::lerpPosition() and added my own ofxCamera::lerpEye() to create this kind of camera movement:

Otherwise you could change the lerp function to follow a curve in stead of interpolating linearly…

Not sure how the blue lines are done, there are probably many different ways to do that.

Could you maybe put your code somewhere so I can download it? That would be great!



my code is pretty messy right now as I’ve had to do it quickly and to be honest I don’t think it would be very useful :slight_smile:

However basically I do this, I have a list of states the camera is in and switch position according to the state:

        case MOVE_TO_CENTRE:  
            if(camera_pos.z < 0)  
                camera.orbitAround(ofxVec3f(centerX, centerY, 0),ofxVec3f(0,1,0),rotateStep*5);  
                camera.lerpPosition(centerX, centerY, centerZ, lerpStep);  

In your case you would just need to track where the lastest paths are being drawn and then do this:

camera.lerpPosition(pathHead.x, cameraY, pathHead.z, lerpStep);  

where cameraY is the height of the camera above the scene you are looking at, and can be decided by you (depending on how far away from the scene you are looking at, and assuming you are drawing in the x-z plane)

Grimus thanks a lot!