Is it possible apply mesh rotation to geometry?

Hello guys!
We did lots of mesh rotation ,after that we need to merge geometries.
Is it possible apply mesh rotation to geometry?
i.e.

    if(e.isMesh){
	    e.geometry.rotateX(e.rotation.x)  // rotate
	    e.geometry.rotateY(e.rotation.y)  // rotate
	    e.geometry.rotateZ(e.rotation.z)  //rotate
	    e.geometry.translate(e.position.x,e.position.y,e.position.z)
	}

You can use applyMatrix4 on geometries.

Yeah i tried this , can’t rotate the geometry.
e.geometry.applyMatrix4(e.matrix)

It should apply all transforms, do you call updateMatrix() on the mesh you want to extract the transforms from before this?

No,I did not,ill try update

图片
This is what it(THREE.Group) should be.
After the transform

    geometries = []
    group.traverse(e=>{
             if(e.isMesh){
	            e.updateMatrix()
                e.geometry.applyMatrix4(e.matrix)
                geometries.push(e.geometry)
	          }
    })
    const geometry = BufferGeometryUtils.mergeBufferGeometries(geometries)
    const mesh = new THREE.Mesh(geometry,material)

图片
It’s something but still not quit the right transform

This is the correct answer.Somethings wrong when perform BufferGeometryUtils.mergeBufferGeometries() I think

1 Like

Not BufferGeometryUtils.mergeBufferGeometries(),it’s because we use mesh.clone(),two twins are messing with each other!