An ultra minimalist JavaScript 3D engine using vanishing points for 3D calculation.
(The glitches seen in the .gif were caused by the screen recorder)
First you need to currently include Fluchtpunkt3D into your project:
-
Paste the "Fluchtpunkt3D/" folder into your "js/" folder
-
Call the "js/Fluchtpunkt3D/setup.js" at the end of your .html file:
(...) <script src="js/Fluchtpunkt3D/setup.js" charset="utf-8"></script> <script src="js/example.js" charset="utf-8"></script> </body> </html>
-
Add a box to your scene:
scene.func.addBox("test", [10,100], [10,100], [20, -10], testMaterial); // scene.func.addBox(name, [x,width], [y,height], [z, depth], material);
-
Optionally edit the "js/Fluchtpunkt3D/setup.js"
// Insert the name of the canvas you want to use here: canvas = document.getElementById( /!\ HERE /!\ );
This project has been rewritten completely, due to a bug that caused the computer to overheat after just a few seconds of running Fluchtpunkt3D
If you want to see the the engine in action just start up the index.html and use the directional arrows to move the box. "N" and "M" elongate / shorten the box. "V" and "B" change the boxes point on the Z-axis. "I", "J", "K" and "L" also move the vanishing point (currently buggy)
increase the FPS by changing the interval inside "js/example.js"
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
Copyright (C) 2004 Sam Hocevar sam@hocevar.net
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- You just DO WHAT THE FUCK YOU WANT TO.