public Vertex Interp(Vertex offset, double t) { this.point = Vector.Interp(this.point, offset.point, t); this.uv.u = this.uv.u + offset.uv.u * t; this.uv.v = this.uv.v + offset.uv.v * t; this.normal = Vector.Interp(this.normal, offset.normal, t); this.color = MyColor.Interp(this.color, offset.color, t); this.WorldPos = Vector.Interp(this.WorldPos, offset.WorldPos, t); return(this); }
public static Vertex Interp(Vertex v1, Vertex v2, double t) { Vertex ret = new Vertex(); ret.point = Vector.Interp(v1.point, v2.point, t); //ret.point.t = v1.point.t + (v2.point.t - v1.point.t) * t; ret.uv.u = v1.uv.u + (v2.uv.u - v1.uv.u) * t; ret.uv.v = v1.uv.v + (v2.uv.v - v1.uv.v) * t; ret.normal = Vector.Interp(v1.normal, v2.normal, t); ret.color = MyColor.Interp(v1.color, v2.color, t); ret.WorldPos = Vector.Interp(v1.WorldPos, v2.WorldPos, t); return(ret); }