0

after creating a litte scenario, with three.js, I tried to implemented Physi.js.

I am stuck on the first object, a cube, I try to change to Physi.js. Firefox console tells me, that "object.material is undefined" at Physi.js line 899.

I tried the following:

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

also this:

    this.cube = new Physijs.BoxMesh(
        new THREE.CubeGeometry( 100, 100, 100 ),        
        new THREE.MeshBasicMaterial ( { color : 0x00ff00 } )
    );

and also this:

      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 );

All lead to the same error, with chandlerprall-Physijs-1558502.

Please tell me, what I am missing here.

Thanks in advance.

Paul
  • 126
  • 1
  • 11
  • So what is on line 899 of Physi.js? I am not familiar with Physi.js. Is Physi.js compatible with three.js? – 2pha Aug 29 '13 at 18:46
  • It should be, as it is recommended here often, for getting physic- functionality and is told so, by the author. I have seen many demos using it, which I tried the code from, too. – Paul Aug 29 '13 at 20:17

0 Answers0