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.
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
Post a Comment