Graphics Reference
In-Depth Information
The reason this cube moves so slowly is that in the background, a movie is being
saved. The libraries used slow down the animation to make sure no frames are
skipped. To save the movie, click on the saveMovie menu button at the top of the
screen.
The resulting movie can now be played in the movie player of your choice, which
supports WebM (for instance, VLC or mPlayer) as shown in the following screenshot:
How to do it…
Once you've included the appropriate libraries in your HTML page, using this library
is actually very easy:
1. The first thing we need to do is create a capture object:
Var capturer = new CCapture({
framerate: 20
});
Here, we create a capturer that captures 20 frames per second.
2. The next step before we start rendering the scene is to start capturer :
capturer.start();
// call the render loop
render();
3. We also need to tell capturer what to capture in the render loop:
function render() {
renderer.render(scene, camera);
Search WWH ::




Custom Search