The question is answered, right answer was accepted
Mesh manipulation : My object is in the field of view but Unity thinks it's not
Hello,
I am meeting a very interesting issue about mesh manipulation and rendering.
I have a basic square-shaped plane. I need to make it match with my area size, so I move vertices to make the plane at the correct size. The problem comes when Unity computes which object should be rendered beacause it is in the camera's field of view. Unity considers the size and position of my origin basic square, and not the size of my actual mesh, with modified vertices.
This picture will be more clear :
If the size of the basic square is out of the field of view, so the object is not rendered, even if a part of it is actually in the field of view.
I have no idea how to tell Unity to reconsider the mesh size, and I meet some difficulty when I try to formulate Google requests about this.
Does someone know what I should do ? Thank you for your help.
Good question, well written , well visualized.
+1
(Especially for accepting an answer and voting those answers ^^)
Wee need more question of that quality.
Answer by Avanak · Aug 26, 2016 at 01:14 PM
You are likely looking for Mesh.RecalculateBounds();
https://docs.unity3d.com/ScriptReference/Mesh.RecalculateBounds.html
Perfect ! This simple line was exactly what I was looking for.
(just wasn't able to find it myself XD)
Thank you very much Avanak and $$anonymous$$Watts
Answer by DavidWatts · Aug 26, 2016 at 01:14 PM
Have you tried Mesh.RecalculateBounds? https://docs.unity3d.com/ScriptReference/Mesh.RecalculateBounds.html
Follow this Question
Related Questions
Assigning uvs to "procedural" mesh. 2 Answers
Create Runtime Mesh (plane) Inside linked points Like in the image . 0 Answers
Is there any way to interact with one vertex of a mesh like a clicking event? 0 Answers
How do you generate a circle terrain mesh 0 Answers
How to force rendering on intersecting objects (or alternative solution)? 0 Answers