faster and more memory efficient wireframes
This commit is contained in:
parent
9ed88bb938
commit
f891caa99d
1 changed files with 7 additions and 4 deletions
|
|
@ -37,7 +37,12 @@ let materials = mesh.material = {
|
||||||
specular: 0x181818,
|
specular: 0x181818,
|
||||||
color: 0x00ff00,
|
color: 0x00ff00,
|
||||||
opacity: 1
|
opacity: 1
|
||||||
})
|
}),
|
||||||
|
wireframe: new THREE.MeshBasicMaterial({
|
||||||
|
side: THREE.DoubleSide,
|
||||||
|
wireframe: true,
|
||||||
|
color: 0x0
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 3D model rendered on plaform **/
|
/** 3D model rendered on plaform **/
|
||||||
|
|
@ -164,9 +169,7 @@ mesh.model = class MeshModel extends mesh.object {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
this.material({clone:true});
|
this.material({clone:true});
|
||||||
this._wireo = this.opacity();
|
this._wireo = this.opacity();
|
||||||
this._wire = new THREE.LineSegments(
|
this._wire = new THREE.Mesh(this.mesh.geometry, materials.wireframe);
|
||||||
new THREE.WireframeGeometry(this.mesh.geometry),
|
|
||||||
new THREE.LineBasicMaterial({ color: opt.color || 0 }));
|
|
||||||
this.mesh.add(this._wire);
|
this.mesh.add(this._wire);
|
||||||
this.opacity(opt.opacity || 0);
|
this.opacity(opt.opacity || 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue