Hello i having some trouble with well known triangulator class.I implemented the triangulator class directly without an edit.My aim is to create a volumetric light depending on the direction but im having this issue relative with triangles appearently.
[90695-display1.png*_|90695]
Another view
[90696-display2.png*_|90696]
i keep the positions of the red colored rays start&end locations and i put these locations as vertices in MESH FILTER component.
public void buildSingleVolume()
{
Mesh _mesh = new Mesh ();
_mesh.name = "VolumeMesh";
for (int i = 0; i < _vert2d.Length; i++)
{
_vert3d <em>= new Vector3 (_vert2d<em>.x,_vert2d*.y,0);*</em></em>
* }*
* Triangulator _tr = new Triangulator (_vert2d);
int indices = _tr.Triangulate ();*
* _mesh.vertices = _vert3d;
_mesh.triangles =indices;
_mesh.RecalculateNormals ();
_mesh.RecalculateBounds ();*
* GameObject instance = Instantiate (volume, Vector2.zero,new Quaternion(0,0,0,0)) as GameObject;
instance.tag = “VolumeL”;
instance.GetComponent ().mesh = mesh;*
* }*
the mesh would show up with exact positions of red rays but it has many zig-zag or false structure.
*
*