瀏覽代碼

PlaneHelper: highlight front-side of plane

WestLangley 8 年之前
父節點
當前提交
90edc74e62
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      src/helpers/PlaneHelper.js

+ 16 - 0
src/helpers/PlaneHelper.js

@@ -29,6 +29,22 @@ function PlaneHelper( plane, size, hex ) {
 
 
 	this.geometry.computeBoundingSphere();
 	this.geometry.computeBoundingSphere();
 
 
+	//
+
+	var positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ];
+
+	var geometry = new BufferGeometry();
+
+	geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
+
+	var child = new THREE.Mesh( geometry, new LineBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false } ) );
+
+	child.geometry.computeBoundingSphere();
+
+	this.add( child );
+
+	//
+
 	this.onBeforeRender();
 	this.onBeforeRender();
 
 
 }
 }