public void UpdateCorners(DistortionHandle sender)
    {
        return;

        for (int i = 0; i < 4; i++)
        {
            sourcePoints[i]      = Handles[i].OriginalHandlePosition;
            destinationPoints[i] = Handles[i].transform.localPosition;
        }

        for (int i = 0; i < 4; i++)
        {
            Handles[i].Corner.localPosition = DistortionHelper.TransferPoint(Handles[i].OriginalCornerPosition.x, Handles[i].OriginalCornerPosition.y, sourcePoints, destinationPoints, true);
        }
    }
Exemplo n.º 2
0
    void updateVerts()
    {
        for (int i = 0; i < 4; i++)
        {
            //sourceCorners[i] = SourceCorners[i].localPosition;
            destinationCorners[i] = DestinationCorners[i].localPosition;
        }

        for (int row = 0; row < rows; row++)
        {
            float y = row / (float)(rows - 1);
            for (int col = 0; col < cols; col++)
            {
                float x = col / (float)(cols - 1);
                verts[row * cols + col] = DistortionHelper.TransferPoint(x, y, sourceCorners, destinationCorners);
            }
        }

        mesh.vertices = verts;
    }
Exemplo n.º 3
0
 public Vector3 TransferPoint(float x, float y)
 {
     return(DistortionHelper.TransferPoint(x, y, sourceCorners, destinationCorners));
 }