2

When I load my model(map) with JSONLoader I have a problem with collisions. If I load with BoxMesh it's work but the geometry collisions is like a cube, and my model is not a cube, the middle of my model is empty. And I put an other object (cube) on the top of my map the object stop on the top of this map not inside.

After search, I have load my model with Convex, and the object ont the top , fall on the plane of my map but I think the size (40) is not load correctly because if I move the object very little he fall in the space.

I load my model like this:

 var loader = new THREE.JSONLoader();
 loader.load( "essai/lobby3.js", function( lobby_geometry, lobby_materials ) {
 console.log(lobby_geometry);
 var ground_material = Physijs.createMaterial(
            new THREE.MeshFaceMaterial(lobby_materials),
            .8, // high friction
            0 // low restitution
        );

    mesh = new Physijs.Mesh ( //I try with BoxMesh / Convex / Concav
                    lobby_geometry,
                    ground_material,
                    0
                );
       mesh.scale.set(40,40,40);
       scene.add(mesh);    
});

I don't know if it's very easy to understand the problem.

BoxMesh: Here the object is stop. sans titre3

Convex: Don't detect collisions sans titre

I upload my tests, I think maybe is better to undestand : http://www.hebergeurfichier.com/download/a97e3ae31c36dfe98525213cde90165f.html

PS: I create my models with blender and export in three.js extension.

gaet
  • 113
  • 6
  • I remember reading something about `mesh.scale` not affecting the collision shape. Try scaling the geometry (raw vertex data) before constructing the `Physijs.ConcaveMesh`. – jozxyqk Dec 08 '13 at 04:21
  • After many test, I have scale all of vertex of the model (ex: mesh.vertices[i].x*=40); The collision and dimensions works fine but the cube stay on the top of my model, not inside. Someone have a tutorial with blender export/import or a small exemple or an other software like blender whose work fine three.js plz? – gaet Jan 16 '14 at 08:33
  • Any news on how this got solved? If it did? Having the same problem and opened an issue on GitHub: https://github.com/chandlerprall/Physijs/issues/271 – riccardolardi Jun 09 '16 at 09:53

0 Answers0