Field of View Tutorial E02 - FoV Mesh - by Sebastian Lague
January 16, 2019 Field of View Tutorial – E02 Youtube -Field of view visualisation (E02) By: Sebastian Lague This is the second part of a tutorial creating a field of view (FoV) for a character in Unity. This focuses on an in-game visualization of the field of view that fills the entire viewing area. FoV visualization is a generated mesh. This will be built from tris made up by the character’s position and the end point of each ray cast within the FoV. A struct was created to hold all of the information for the raycasts. Used transform.InverseTransformPoint to convert a point (Vector3) from a global value to a local value. The FoV mesh initially had an issue dealing with the corners/edges of obstacles. A high resolution was needed (many rays cast) to reduce the visual jitter effect around obstacle corner/edges. This was addressed further in the tutorial. To solve this, approached the problem by determining when rays go from hitting obstacle to missing obstacle, and label these ...
Comments
Post a Comment