Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apbln opened this issue Sep 25, 2019 · 0 comments
Open

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

apbln opened this issue Sep 25, 2019 · 0 comments

Comments

@apbln
Copy link

apbln commented Sep 25, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant