提交 99152132 编写于 作者: M Mr.doob

Merge pull request #6090 from pavelvasev/pointcloud-export-import

Pointcloud export import
......@@ -693,7 +693,7 @@ THREE.Object3D.prototype = {
data.color = object.color.getHex();
data.groundColor = object.groundColor.getHex();
} else if ( object instanceof THREE.Mesh ) {
} else if ( object instanceof THREE.Mesh || object instanceof THREE.PointCloud ) {
data.geometry = parseGeometry( object.geometry );
data.material = parseMaterial( object.material );
......
......@@ -51,6 +51,10 @@ THREE.MaterialLoader.prototype = {
if ( json.transparent !== undefined ) material.transparent = json.transparent;
if ( json.wireframe !== undefined ) material.wireframe = json.wireframe;
// for PointCloudMaterial
if ( json.size !== undefined ) material.size = json.size;
if ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;
if ( json.materials !== undefined ) {
for ( var i = 0, l = json.materials.length; i < l; i ++ ) {
......
......@@ -155,6 +155,15 @@ THREE.Material.prototype = {
if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending;
if ( this.side !== THREE.FrontSide ) output.side = this.side;
} else if ( this instanceof THREE.PointCloudMaterial ) {
output.size = this.size;
output.sizeAttenuation = this.sizeAttenuation;
output.color = this.color.getHex();
if ( this.vertexColors !== THREE.NoColors ) output.vertexColors = this.vertexColors;
if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending;
} else if ( this instanceof THREE.ShaderMaterial ) {
output.uniforms = this.uniforms;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册