Solved: transparent material render problem

question:
for example,
mesh A /box scale(70,30,10),position(0,0,0),not transparent at all;
mesh B/ box scale(10,10,10),position(0,0,0),transparent material
how can i make it looks like i cut a hole(shape like B) in A

solution:
i solved it。
let transparent mesh (B) slightly thicker than A
let B render before A(set renderorder)
set transparent material depthWrite=true;

      const transparentMaterial = new THREE.MeshStandardMaterial({transparent:true,opacity:0.1,envMapIntensity:0,depthWrite:true})

could you draw a sketch of what you want? you can cut holes yes but then what?

you can use GitHub - gkjohnson/three-bvh-csg: A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh in vanilla three of course.

like a window on a wall ,i can look through it to see things inside/outside
image

image
i think just like this.i can look through the door and the window,how can i achieve something like this

Look at what @drcmda replied to you!
That’s the way to go if you need to do it dynamically.

If you just need it once in a model, you want to do it in a 3d modeller, like Blender and use boolean modifiers to cut the objects, export the scene as GLB and load in back threejs.)

i solved it, thanks

i solved it ,thanks