Skip to content

CSG doesn't consider positions and rotations of meshes #46

Description

@apbln

I want the CSG-operation to be executed with the new position and rotation of the meshes, but they are ignored. the CSG-result always shows up at zero-point.
I’ve added the two meshes to the scene to make it obvious where I want the CSG-operation to take place.

grafik

    var cubeGeometry2 = new THREE.CubeGeometry( 200, 400, 100, 1, 1, 1 );
        var cubeMesh2 = new THREE.Mesh( cubeGeometry2 );   
        cubeMesh2.position.set( 130, 900, 0);  // the ThreeBSP ignores this
        //cubeMesh2.rotation.set(new THREE.Vector3( 0, 600, 0)); 
        var cubeBSP2 = new ThreeBSP( cubeMesh2 );
     
        //scene.add( cubeMesh2 );

        var cubeGeometry3 = new THREE.CubeGeometry( 100, 300, 100, 1, 1, 1 );
        var cubeMesh3 = new THREE.Mesh( cubeGeometry3 );
        var cubeBSP3 = new ThreeBSP( cubeMesh3 );
        cubeMesh3.position.set( 0, 900, 0);
        scene.add( cubeMesh3 );
        var material = new THREE.MeshBasicMaterial({
            color: 0x1266bb,
            vertexColors: THREE.FaceColors
        });

        var newBSP = cubeBSP2.subtract( cubeBSP3 ); 
        var newMesh = newBSP.toMesh( material );
        newMesh.position.set( 0, 200, 0);
        scene.add( newMesh );

Am I missing something or is this a bug?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions