public void readyPatch(int patchIndex) { ITimeDiffeomorphism patch = _surface.getPatches()[patchIndex]; float time = Time.time; Debug.Log(_centers.GetLength(1)); for (int i = 0; i < _centers.GetLength(1); ++i) { Vector2 uv_coord = _centers[patchIndex, i]; Vector3 image = patch.call(uv_coord, time); Vector3[] basis = new Vector3[2]; basis[0] = patch.uVelocity(uv_coord, time); basis[1] = patch.vVelocity(uv_coord, time); //TODO: make not ugly _vertices.Add(new Vector3(image.x + (_triangleLength * (Mathf.Sin(0) * basis[0].x + Mathf.Cos(0) * basis[1].x)), image.y + (_triangleLength * (Mathf.Sin(0) * basis[0].y + Mathf.Cos(0) * basis[1].y)), image.z + (_triangleLength * (Mathf.Sin(0) * basis[0].z + Mathf.Cos(0) * basis[1].z)))); _vertices.Add(new Vector3(image.x + (_triangleLength * (Mathf.Sin(2.0944f) * basis[0].x + Mathf.Cos(2.0944f) * basis[1].x)), image.y + (_triangleLength * (Mathf.Sin(2.0944f) * basis[0].y + Mathf.Cos(2.0944f) * basis[1].y)), image.z + (_triangleLength * (Mathf.Sin(2.0944f) * basis[0].z + Mathf.Cos(2.0944f) * basis[1].z)))); _vertices.Add(new Vector3(image.x + (_triangleLength * (Mathf.Sin(4.18879f) * basis[0].x + Mathf.Cos(4.18879f) * basis[1].x)), image.y + (_triangleLength * (Mathf.Sin(4.18879f) * basis[0].y + Mathf.Cos(4.18879f) * basis[1].y)), image.z + (_triangleLength * (Mathf.Sin(4.18879f) * basis[0].z + Mathf.Cos(4.18879f) * basis[1].z)))); for (int q = 0; q < 3; ++q) { _colors.Add(Color.red); } } }
public override Vector3 call(Vector2 pt, float time) { return(_d1.call(pt, time) * (1 - Mathf.Abs(Mathf.Sin(time))) + Mathf.Abs(Mathf.Sin(time)) * _d2.call(pt, time)); }