Hello,
I’m trying to use the morph targets manager and boolean operation at the same time, but it does not work. It seems like the change in morph target doesn’t affect the original mesh. I want to create a hole that can be updated using the morph target manager parameter. Here is the playground:
https://playground.babylonjs.com/#H6YPT8#16
Thank you in advance for your help !
Adding @bghgary as he knows morph target way more than me
Thanks @bghgary
1 Like
Welcome to the forum!
Morph targets are applied on the GPU and thus the CPU-based CSG you are using will not pick up the difference. Can you explain your scenario? Maybe there is a different way to do what you want.
2 Likes
Thank you for your response.
I create a door/a window whose dimension and shape can be changed by some range slider inputs. It will make a hole on the wall that I can look through inside the house. And I want to make the hole adapt to changes made on door/window
It possible to retrieve from morph target the values of points which initialize the morph ?
Yes, this is possible. See morphTarget.getPositions and sibling functions.
If your shapes are only changing in size, you might consider modifying the scale of the mesh instead of using morph targets.
Thank you for your quick answer.
I took a look at morphTarget.getPositions but points didnt change when I change the dimension. Do you know a function to get the mesh from the morph target modifications ?
For the scale modification uvs and the form of the shape will be modified, and morph targets already manage that.
This function doesn’t exist. The “modifications” happen on the GPU. We don’t have a CPU equivalent.
It depends what you want. There are ways (e.g. change the uv scale) to make the UVs work right even if you change the mesh scale. Morph targets can do it, but you can’t easily get the resulting modified attributes.