I'd like to share with you a snipped of code I believe you'll like. The camera tracking part.

First lets see the video.

This composition is about thousands of dots distributed in a tridimensional space limited on its axes, making up a cube.

A camera was created to navigate inside the cube. It translates at a fixed velocity until it bounces on the edges. What I did that was exceptional was to add a little easing on the edges to give it a cool effect.

I'll show you this technique. Its simple and it gives a great visual as you already saw.

As we can easily infer, the technique for reproducing the object bouncing inside the cube is given by this code:

```// cube with 100 unities for its side
int side = 100;

// camera
double x;
double y;
double z;

double speedX;
double speedY;
double speedZ;

// ...
// A random speed is set for the camera
// ...

// main loop

// extrapolating the left side
if(x < 0)
{
x = 0;
speedX *= -1; // we invert the speed
}
// extrapolating the right side
if(x > side)

{
x = side;
speedX *= -1; // we invert the speed
}
// ...
// It repeats for the next dimentions
// ...

// At the end of the loop, we update the camera's position
```

Now, lets alter the collision detection part inside the main loop and add some easing. We need to create an auxiliary variable that is going to store the original object's speed because this collision is supposed to be 100% elastic:

```int SOriginalX = 0;

if( x < 0 || x > side)

{
// If there was a collision to the edge, the speed certainly its not
// null.
//
// Knowing this, we take some C gimmick and use the value 0 in a
// conditional to indicate the variable 'SOriginalX' is clean to be used
// as a reference of the original object's speed before its collision to
// the edge.

if(!SOriginalX) SOriginalX = speedX;

// 0.01 is an arbitrary value that indicates how smooth the slowing and
// the and its subsequent acceleration is going to be.

speedX -= SOriginalX*0.01;

// speedX eventually wil change its signal, which is going to make the
// object go back inside the cube's limits and leave this 'if' clause.

}else
// Reset the axiliary variable for reuse
VOriginalX = 0;

// ...
// It repeats for the next dimentions
// ...
```