I’m trying to get really close to the surface of a mesh to look at the small details. I’m using this Playground as an example:
As far as I know setting the minZ value quite low should be sufficient, but no matter what I set this to the mesh instantly disappears whenever I get close. I’ve set it to 1, .5, .01 and I still get the same result. I assume the bounding box of the mesh is being hit by the camera and it no longer renders the mesh.
I also tried setting the camera framing behavior to:
camera.useFramingBehavior = true;
camera.framingBehavior.mode = BABYLON.FramingBehavior.IgnoreBoundsSizeMode;
This didn’t seem to make a difference either. I’ve set this up before, but I must be missing something. Do I need to set something else for this to work?
I’d like to get close enough to get inside the eye socket of the skull mesh shown in the playground.
Hello
It could have come from camera.minZ
, but in this case it comes from the camera movement of ArcRotate. It’s centered on a specific point. If this point is behind or inside the mesh, zooming in you will just enter the mesh (and it disapears due to backface culling)
In this Playground I have set up a pick event where it centers the camera on the mesh surface at the point you click. Then you can zoom in at any detail level
++
Tricotou
2 Likes
Awesome, that was actually something I was going to implement next, so nice to see it working. So in essence, setting the target ensures the camera always has that target in view. With the method you implemented, it dynamically changes the target to a specific point on the mesh.
Interesting that with this method, panning still works but if you set the target initially panning will not work. This is something I was also trying to implement with some key press check. Thanks, this solved a few things I was trying to implement!