asd*_*sdf 0 javascript three.js
我开始使用three.js,但在THREE.MeshLambertMaterial();何处出现错误
this.setValues is not a function
在这块threejs的源代码中:
三.js
THREE.MeshLambertMaterial = function ( parameters ) {
THREE.Material.call( this );
this.type = 'MeshLambertMaterial';
this.color = new THREE.Color( 0xffffff ); // diffuse
this.map = null;
this.lightMap = null;
this.lightMapIntensity = 1.0;
this.aoMap = null;
this.aoMapIntensity = 1.0;
this.emissive = new THREE.Color( 0x000000 );
this.emissiveIntensity = 1.0;
this.emissiveMap = null;
this.specularMap = null;
this.alphaMap = null;
this.envMap = null;
this.combine = THREE.MultiplyOperation;
this.reflectivity = 1;
this.refractionRatio = 0.98;
this.wireframe = false;
this.wireframeLinewidth = 1;
this.wireframeLinecap = 'round';
this.wireframeLinejoin = 'round';
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
--> this.setValues( parameters );
};
Run Code Online (Sandbox Code Playgroud)
来自我的 javascript 中的这个调用:
图形.js
var sphereMaterial = THREE.MeshLambertMaterial(
{color: 0x55B663});
Run Code Online (Sandbox Code Playgroud)
有没有人对此错误有任何经验和/或知道可能导致它的原因?
创建新材料或几何体时使用关键字new:
var sphereMaterial = new THREE.MeshLambertMaterial({color: 0x55B663});
Run Code Online (Sandbox Code Playgroud)
旁注:您可以通过在控制台中键入THREE.REVISION或仅查看文件three.js/的顶部来查看您发布的版本号three.min.js。
| 归档时间: |
|
| 查看次数: |
2052 次 |
| 最近记录: |