Skip to content

A single cube that transforms itself into a big cube, written in JavaScript using P5JS

License

Notifications You must be signed in to change notification settings

johnnyawesome/TransformingCubes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

TransformingCubes

A single cube that transforms itself into a big cube, written in JavaScript using P5JS.

TransformingCubesRotating

About the Project

This is a continuation of my ShiftingCubes Project!

It uses the same codebase.

How to use

There are several settings giving you full control over the cube:

//Rotate the cubes when transforming
const rotateCubes = false;
//Size of the cubes
const cubeSize = 60;
//Distance between cubes
const cubeDist = 0.0001;
const delta = cubeSize + cubeDist;
//Length in cubes of one side (e.g. '5' will produce a 5 x 5 x 5 cube)
const cubeNum = 5;

The one coolest setting is this one:

//Rotate the cubes when transforming
const rotateCubes = false;

If you set it to 'false' you'll get this animation:

TransformingCubesNoRotating

Set it to 'true' to get this:

TransformingCubesRotating

Enjoy!