一个轻量级的3D CSS 库_html/css_WEB-ITnose
Jun 21, 2016 am 08:57 AM
JavaScript 3D library
该项目的目的是为了打造轻量级的、实用简单的3D CSS库。
Usage使用方法
下载 minified库文件 和 css文件,并将其包含于你的HTML中,就如此简单。
<script src="js/voxelcss.js"></script><link rel='stylesheet' href="css/voxel.css"></link>
下面这段代码既是对其应用:
<script> var scene, world, editor; init(); function init() { scene = new voxelcss.Scene(); scene.rotate(-Math.PI / 8, Math.PI / 4, 0); scene.attach(document.body); var lightSource = new voxelcss.LightSource(300, 300, 300, 750, 0.3, 1); scene.addLightSource(lightSource); world = new voxelcss.World(scene); editor = new voxelcss.Editor(world); editor.enableAutoSave(); editor.load(); if(world.getVoxels().length === 0) editor.add(new voxelcss.Voxel(0, 0, 0, 100, { mesh: voxelcss.Meshes.grass })); }</script>
- 官方文档
- 3D CSS 应用 Demo

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input?

What is the purpose of the <iframe> tag? What are the security considerations when using it?

How to efficiently add stroke effects to PNG images on web pages?

What is the purpose of the <meter> element?

What is the purpose of the <datalist> element?

What is the viewport meta tag? Why is it important for responsive design?

What is the purpose of the <progress> element?
