2
0
Эх сурвалжийг харах

Cleanup code in css3d_molecules example (#25587)

Nathan Bierema 2 жил өмнө
parent
commit
d2c88a05df

+ 5 - 5
examples/css3d_molecules.html

@@ -370,11 +370,7 @@
 
 						//
 
-						bond = document.createElement( 'div' );
-						bond.className = 'bond';
-						bond.style.height = bondLength + 'px';
-
-						const joint = new THREE.Object3D( bond );
+						const joint = new THREE.Object3D();
 						joint.position.copy( start );
 						joint.position.lerp( end, 0.5 );
 
@@ -384,6 +380,10 @@
 						joint.matrixAutoUpdate = false;
 						joint.updateMatrix();
 
+						bond = document.createElement( 'div' );
+						bond.className = 'bond';
+						bond.style.height = bondLength + 'px';
+
 						object = new CSS3DObject( bond );
 						object.rotation.y = Math.PI / 2;