javascript - How do three.js transforms and CSS3 3D-transforms correspond? -


i working on open source tool navigating , visualizing human anatomy.

the main object of interest 'chessboard' taking of screen. dragging board around performs css3 3d-transforms. 3d object (a head, in example below) shown hovering on board, rendered three.js.

enter image description here

enter image description here

the transformation of head synchronized of board. imperfect synchronization, realized trial-and-error.

how 'css 3d world' , 'three.js/webgl 3d world' correspond? example, 'camera' in css world? there way synchronize 2 properly? better, there library?

they synchronize. try hacking http://threejs.org/examples/css3d_sandbox.html.

you should able create css3dobject , planegeometry line perfectly, assuming same camera used render both.

var geometry = new three.planegeometry(100, 100); var mesh = new three.mesh( geometry, material );  mesh.position.copy( object.position ); mesh.rotation.copy( object.rotation ); mesh.scale.copy( object.scale );  scene.add( mesh ); 

in fact, here fiddle: http://jsfiddle.net/l9cun/

three.js r.66


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -