Edit: No longer implementing this, see below
-
start/stopCamera()
-
Using time, we can start and stop effects of current p5.camera methods like tilt()
, setPosition()
move()
, pan()
, lookAt()
. See these cases -
-
startCamera( t ) / startInterval( t )
- starts the effects after t seconds. If none of the above methods are called before, the defaultcamera()
is used. Aftert
seconds, the previous methods are stopped and subsequent methods are called.The usage can be like this.-
cam1 = createCamera(); cam1.setPosition(30, 0, 50); cam1.lookAt(0, 0, 0); cam1.startcamera(5); cam1.move(5,0,0);
Here, after 5 seconds of rendering the sketch, the camera will start to move.
-
stopCamera( t ) / stopInterval( t )
- ends the effects after t seconds. If none of the above methods are called after, the defaultcamera()
is used. Aftert
seconds, the previous methods are stopped and subsequent methods are called.cam1 = createCamera(); cam1.setPosition(30, 0, 50); cam1.lookAt(0, 0, 0); cam1.startcamera(5); cam1.move(5,0,0); cam1.stopcamera(10); cam1.lookAt(10,0,0);
Here, after 5 seconds of rendering the sketch, the camera will start to move. And then after 5 more seconds, it will stop, and will be oriented to look at (10,0,0),
At the moment, I cannot decide a name for this function, as start/stopCamera()
is a kind of misnomer, and a little misdirecting, but as is start/stopInterval()
. I will update as I come up with new ideas.