Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未定义具有physijs对象材质的three.js_Javascript_Three.js_Physijs - Fatal编程技术网

Javascript 未定义具有physijs对象材质的three.js

Javascript 未定义具有physijs对象材质的three.js,javascript,three.js,physijs,Javascript,Three.js,Physijs,在创建了一个litte场景之后,使用three.js,我尝试实现Physi.js 我被困在第一个对象上,一个立方体,我试图更改为Physi.js。 Firefox控制台告诉我,Physi.js第899行的“object.material未定义” 我尝试了以下方法: this.cube = new Physijs.BoxMesh( new THREE.CubeGeometry( 100, 100, 100 ), Physijs.createM

在创建了一个litte场景之后,使用three.js,我尝试实现Physi.js

我被困在第一个对象上,一个立方体,我试图更改为Physi.js。 Firefox控制台告诉我,Physi.js第899行的“object.material未定义”

我尝试了以下方法:

    this.cube = new Physijs.BoxMesh(
        new THREE.CubeGeometry( 100, 100, 100 ),        
        Physijs.createMaterial(
            new THREE.MeshBasicMaterial ( { color : 0x00ff00 } )
            ,.4,.8),0
    );
还包括:

    this.cube = new Physijs.BoxMesh(
        new THREE.CubeGeometry( 100, 100, 100 ),        
        new THREE.MeshBasicMaterial ( { color : 0x00ff00 } )
    );
      box.material = new THREE.MeshLambertMaterial({
          color: 0x00FF00
      });
      box.material = Physijs.createMaterial( box.material, 0.4, 0.6 );
      box.geometry = new THREE.CubeGeometry( 4, 4, 4 );
还有:

    this.cube = new Physijs.BoxMesh(
        new THREE.CubeGeometry( 100, 100, 100 ),        
        new THREE.MeshBasicMaterial ( { color : 0x00ff00 } )
    );
      box.material = new THREE.MeshLambertMaterial({
          color: 0x00FF00
      });
      box.material = Physijs.createMaterial( box.material, 0.4, 0.6 );
      box.geometry = new THREE.CubeGeometry( 4, 4, 4 );
所有这些都会导致相同的错误,chandlerprall-Physijs-1558502

请告诉我,我错过了什么


提前谢谢。

那么Physi.js的第899行有什么内容?我不熟悉Physi.js。Physi.js与three.js兼容吗?正如这里经常推荐的那样,为了获得physic功能,应该兼容three.js。我已经看到很多使用它的演示,我也尝试了其中的代码。