您可以像这样创建一个多维数据集CSS3DRenderer
:
// params
var r = Math.PI / 2;
var d = 50;
var pos = [ [ d, 0, 0 ], [ -d, 0, 0 ], [ 0, d, 0 ], [ 0, -d, 0 ], [ 0, 0, d ], [ 0, 0, -d ] ];
var rot = [ [ 0, r, 0 ], [ 0, -r, 0 ], [ -r, 0, 0 ], [ r, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ];
// cube
var cube = new THREE.Object3D();
scene.add( cube );
// sides
for ( var i = 0; i < 6; i ++ ) {
var element = document.createElement( 'div' );
element.style.width = '100px';
element.style.height = '100px';
element.style.background = new THREE.Color( Math.random() * 0xffffff ).getStyle();
element.style.opacity = '0.50';
var object = new THREE.CSS3DObject( element );
object.position.fromArray( pos[ i ] );
object.rotation.fromArray( rot[ i ] );
cube.add( object );
}
小提琴:http: //jsfiddle.net/MdPrb/7
三.js r.64