Search Unity

Question Custom-made mesh getting getting occluded at odd angles

Discussion in 'General Graphics' started by camelron, Jun 19, 2020.

  1. camelron

    camelron

    Joined:
    Nov 3, 2018
    Posts:
    3
    I'm trying to create a holographic ring-shaped mesh using a script. (think a sideways ladder looping around in a circle). The mesh seems to be generated fine and the normals also seem correct. For some odd reason, the mesh becomes invisible at angles where it should still clearly be in view.

    This mostly happens when the camera is on the inside of the ring. My understanding was that as long as the triangles are clockwise with respects to the camera, the face is visible. In any case, every face has a clockwise and counterclockwise triangle so it should be visible from both sides.



    Does anyone have an idea of how to fix this so that the mesh faces are viewable at all angles?
     
    Last edited: Jun 19, 2020
  2. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,767
    Update the mesh bounds.
     
    camelron likes this.
  3. camelron

    camelron

    Joined:
    Nov 3, 2018
    Posts:
    3
    That was exactly it, thanks so much!

    For anyone else who discovers this, Unity even includes a helpful
    Code (CSharp):
    1. mesh.RecalculateBounds()
    function.