Exemplo n.º 1
0
    void Start()
    {
        webcam = FindObjectOfType (typeof(WebCamHandler)) as WebCamHandler;

        mesh = new Mesh ();
        mesh.MarkDynamic ();
        GetComponent <MeshFilter> ().mesh = mesh;

        mesh.vertices = new Vector3[length];

        var indices = new int[length];
        for (var i = 0; i < length; i++)
        {
            indices[i] = i;
        }
        mesh.SetIndices (indices, MeshTopology.LineStrip, 0);
        lastPoint = new Vector3 (Random.Range (-0.5f, 0.5f), Random.Range (-0.5f, 0.5f));;
    }
Exemplo n.º 2
0
    void Start()
    {
        webcam = FindObjectOfType(typeof(WebCamHandler)) as WebCamHandler;

        mesh = new Mesh();
        mesh.MarkDynamic();
        GetComponent <MeshFilter> ().mesh = mesh;

        mesh.vertices = new Vector3[length];

        var indices = new int[length];

        for (var i = 0; i < length; i++)
        {
            indices[i] = i;
        }
        mesh.SetIndices(indices, MeshTopology.LineStrip, 0);
        lastPoint = new Vector3(Random.Range(-0.5f, 0.5f), Random.Range(-0.5f, 0.5f));;
    }