Jump to content

How to hide GUI.Multiline when all the connected meshes are behind the camera


mind0n
 Share

Recommended Posts

 I don't have much time to sort out all the solution, but here is a possible path of action.

1) use:

let nearPlane = BABYLON.Frustum.GetNearPlaneToRef(camera.getTransformMatrix());
 
That gives you the equation of the plane that decides if a mesh is still visible when the camera is getting too close.
 
The property nearPlane.normal gives you the a, b, c while nearPlane.d gives you the d of the following plane equation:
 
ax + by + cz + d = 0
 
2) Substitute the x, y, z with the coordinates of one of your meshes.
3) The sign of the result will tells you if the mesh is behind or in front of the plane (I mean: on one side or the other of the plane; you will have to find out which one is front/behind).
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...