Git Product home page Git Product logo

cube3d's Introduction

      ______      __        _____ ____
     / ____/_  __/ /_  ___ |__  // __ \
    / /   / / / / __ \/ _ \ /_ </ / / /
   / /___/ /_/ / /_/ /  __/__/ / /_/ /
   \____/\__,_/_.___/\___/____/_____/

    Add pseudo 3d (minecraft like) elements to HTML without any 3D engine, canvas or OpenGL requirements

English δΈ­ζ–‡

About

This library is mainly developed to add Lightweight interesting pseudo 3D content in the HTML interface, and cannot realize 3D simulation and 3D graphics technology (such as lighting, texture, etc.)

The function of this library is based on CSS3 3D transformation, in which each cube is composed of 6 div planes. So, you can try more traditional HTML editing methods in the div. Just like the screenshot of my blog below.

Image text

Usage

1. include cube3d.css

<link rel="stylesheet" href="dist/cube3d.css">
</head>

2 include vdom.core.js , cube3d.js

</body>
<script src="dist/vdom.core.js"></script>
<script src="dist/cube3d.js"></script>

3 create a Cube instance

var cube = new C3dCube(120,120,120, [30,40,180,1] );

4 Add the cube into the HTML

vdom('body').append( cube.container );

Documentation

C3dNode : An empty node with 3d feature (Used to be a group)

- container     A vdom for HTML/2d display/animation
- cube          A vdom for 3d display/transform/

- move
- rotate
- scale

C3dCube extends C3dNode : The 3d node has 6 visible sides

- Sides         Array of each side
- constract

- top(),bottom(),left(),right(),front(),back()  Get each side 

C3dSide

- vd
- bg
- d (direction id)
- constract

Demo

demo

cube3d's People

Contributors

shezw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.