Show / Hide Table of Contents

Class QuadInterpolation

Supplies various bilinear and trilinear interpolation methods. The conventions are based on a XY plane using either a unit square or unit cube.

Inheritance
object
QuadInterpolation
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Sylves
Assembly: Sylves.dll
Syntax
public static class QuadInterpolation

Methods

GetCorners(MeshData, int, int, bool, out Vector3, out Vector3, out Vector3, out Vector3)

Declaration
public static void GetCorners(MeshData mesh, int submesh, int face, bool invertWinding, out Vector3 v1, out Vector3 v2, out Vector3 v3, out Vector3 v4)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Vector3 v1
Vector3 v2
Vector3 v3
Vector3 v4

GetCorners(MeshData, int, int, bool, float, float, out Vector3, out Vector3, out Vector3, out Vector3, out Vector3, out Vector3, out Vector3, out Vector3)

Declaration
public static void GetCorners(MeshData mesh, int submesh, int face, bool invertWinding, float meshOffset1, float meshOffset2, out Vector3 v1, out Vector3 v2, out Vector3 v3, out Vector3 v4, out Vector3 v5, out Vector3 v6, out Vector3 v7, out Vector3 v8)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
float meshOffset1
float meshOffset2
Vector3 v1
Vector3 v2
Vector3 v3
Vector3 v4
Vector3 v5
Vector3 v6
Vector3 v7
Vector3 v8

Interpolate(Vector2, Vector2, Vector2, Vector2)

As the Vector3 interpolate, only in 2 dimensions.

Declaration
public static Func<Vector3, Vector2> Interpolate(Vector2 v1, Vector2 v2, Vector2 v3, Vector2 v4)
Parameters
Type Name Description
Vector2 v1
Vector2 v2
Vector2 v3
Vector2 v4
Returns
Type Description
Func<Vector3, Vector2>

Interpolate(Vector2, Vector2, Vector2, Vector2, Vector2, Vector2, Vector2, Vector2)

As the Vector3 Interpolate, only in 2 dimensions.

Declaration
public static Func<Vector3, Vector2> Interpolate(Vector2 v1, Vector2 v2, Vector2 v3, Vector2 v4, Vector2 v5, Vector2 v6, Vector2 v7, Vector2 v8)
Parameters
Type Name Description
Vector2 v1
Vector2 v2
Vector2 v3
Vector2 v4
Vector2 v5
Vector2 v6
Vector2 v7
Vector2 v8
Returns
Type Description
Func<Vector3, Vector2>

Interpolate(Vector3, Vector3, Vector3, Vector3)

Bilinear interpolates from a unit square in the XZ plane to the quad supplied by v1 to v4 The z value of p is unused.

Declaration
public static Func<Vector3, Vector3> Interpolate(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4)
Parameters
Type Name Description
Vector3 v1

Final location of (-0.5, 0, -0.5)

Vector3 v2

Final location of (-0.5, 0, 0.5)

Vector3 v3

Final location of (0.5, 0, 0.5)

Vector3 v4

Final location of (0.5, 0, -0.5)

Returns
Type Description
Func<Vector3, Vector3>

Interpolate(Vector3, Vector3, Vector3, Vector3, Vector3, Vector3, Vector3, Vector3)

Tiilinear interpolates from a unit cube to the polyhedron supplied by v1 to v8 The z value of p is unused.

Declaration
public static Func<Vector3, Vector3> Interpolate(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Vector3 v5, Vector3 v6, Vector3 v7, Vector3 v8)
Parameters
Type Name Description
Vector3 v1

Final location of (-0.5, -0.5, -0.5)

Vector3 v2

Final location of (-0.5, -0.5, 0.5)

Vector3 v3

Final location of (0.5, -0.5, 0.5)

Vector3 v4

Final location of (0.5, -0.5, -0.5)

Vector3 v5

Final location of (-0.5, 0.5, -0.5)

Vector3 v6

Final location of (-0.5, 0.5, 0.5)

Vector3 v7

Final location of (0.5, 0.5, 0.5)

Vector3 v8

Final location of (0.5, 0.5, -0.5)

Returns
Type Description
Func<Vector3, Vector3>

Interpolate(Vector4, Vector4, Vector4, Vector4)

As the Vector3 interpolate, only in 4 dimensions.

Declaration
public static Func<Vector3, Vector4> Interpolate(Vector4 v1, Vector4 v2, Vector4 v3, Vector4 v4)
Parameters
Type Name Description
Vector4 v1
Vector4 v2
Vector4 v3
Vector4 v4
Returns
Type Description
Func<Vector3, Vector4>

Interpolate(Vector4, Vector4, Vector4, Vector4, Vector4, Vector4, Vector4, Vector4)

As the Vector3 interpolate, only in 4 dimensions.

Declaration
public static Func<Vector3, Vector4> Interpolate(Vector4 v1, Vector4 v2, Vector4 v3, Vector4 v4, Vector4 v5, Vector4 v6, Vector4 v7, Vector4 v8)
Parameters
Type Name Description
Vector4 v1
Vector4 v2
Vector4 v3
Vector4 v4
Vector4 v5
Vector4 v6
Vector4 v7
Vector4 v8
Returns
Type Description
Func<Vector3, Vector4>

InterpolateNormal(MeshData, int, int, bool)

Declaration
public static Func<Vector3, Vector3> InterpolateNormal(MeshData mesh, int submesh, int face, bool invertWinding)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Returns
Type Description
Func<Vector3, Vector3>

InterpolatePosition(MeshData, int, int, bool)

Declaration
public static Func<Vector3, Vector3> InterpolatePosition(MeshData mesh, int submesh, int face, bool invertWinding)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Returns
Type Description
Func<Vector3, Vector3>

InterpolatePosition(MeshData, int, int, bool, float, float)

Sets up a function that does trilinear interpolation from a unit cube centered on the origin to a cube made by extruding a given face of the mesh by meshOffset1 (for y=-0.5) and meshOffset2 (for y=0.5)

Declaration
public static Func<Vector3, Vector3> InterpolatePosition(MeshData mesh, int submesh, int face, bool invertWinding, float meshOffset1, float meshOffset2)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
float meshOffset1
float meshOffset2
Returns
Type Description
Func<Vector3, Vector3>

InterpolateTangent(MeshData, int, int, bool)

Declaration
public static Func<Vector3, Vector4> InterpolateTangent(MeshData mesh, int submesh, int face, bool invertWinding)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Returns
Type Description
Func<Vector3, Vector4>

InterpolateUv(MeshData, int, int, bool)

Declaration
public static Func<Vector3, Vector2> InterpolateUv(MeshData mesh, int submesh, int face, bool invertWinding)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Returns
Type Description
Func<Vector3, Vector2>

Jacobi(Vector2, Vector2, Vector2, Vector2)

As the Vector3 jacobi, only in 2 dimensions.

Declaration
public static Func<Vector3, Matrix4x4> Jacobi(Vector2 v1, Vector2 v2, Vector2 v3, Vector2 v4)
Parameters
Type Name Description
Vector2 v1
Vector2 v2
Vector2 v3
Vector2 v4
Returns
Type Description
Func<Vector3, Matrix4x4>

Jacobi(Vector3, Vector3, Vector3, Vector3)

Bilinear interpolates from a unit square in the XZ plane to the quad supplied by v1 to v4, returning the jacobi The z value of p is unused.

Declaration
public static Func<Vector3, Matrix4x4> Jacobi(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4)
Parameters
Type Name Description
Vector3 v1

Final location of (-0.5, 0, -0.5)

Vector3 v2

Final location of (-0.5, 0, 0.5)

Vector3 v3

Final location of (0.5, 0, 0.5)

Vector3 v4

Final location of (0.5, 0, -0.5)

Returns
Type Description
Func<Vector3, Matrix4x4>

Jacobi(Vector3, Vector3, Vector3, Vector3, Vector3, Vector3, Vector3, Vector3)

Tiilinear interpolates from a unit cube to the polyhedron supplied by v1 to v8, returning the jacobi The z value of p is unused.

Declaration
public static Func<Vector3, Matrix4x4> Jacobi(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Vector3 v5, Vector3 v6, Vector3 v7, Vector3 v8)
Parameters
Type Name Description
Vector3 v1

Final location of (-0.5, -0.5, -0.5)

Vector3 v2

Final location of (-0.5, -0.5, 0.5)

Vector3 v3

Final location of (0.5, -0.5, 0.5)

Vector3 v4

Final location of (0.5, -0.5, -0.5)

Vector3 v5

Final location of (-0.5, 0.5, -0.5)

Vector3 v6

Final location of (-0.5, 0.5, 0.5)

Vector3 v7

Final location of (0.5, 0.5, 0.5)

Vector3 v8

Final location of (0.5, 0.5, -0.5)

Returns
Type Description
Func<Vector3, Matrix4x4>

JacobiPosition(MeshData, int, int, bool)

Declaration
public static Func<Vector3, Matrix4x4> JacobiPosition(MeshData mesh, int submesh, int face, bool invertWinding)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Returns
Type Description
Func<Vector3, Matrix4x4>

JacobiPosition(MeshData, int, int, bool, float, float)

Returns the Jacobi (derivative) of InterpolatePosition

Declaration
public static Func<Vector3, Matrix4x4> JacobiPosition(MeshData mesh, int submesh, int face, bool invertWinding, float meshOffset1, float meshOffset2)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
float meshOffset1
float meshOffset2
Returns
Type Description
Func<Vector3, Matrix4x4>

JacobiUv(MeshData, int, int, bool)

Declaration
public static Func<Vector3, Matrix4x4> JacobiUv(MeshData mesh, int submesh, int face, bool invertWinding)
Parameters
Type Name Description
MeshData mesh
int submesh
int face
bool invertWinding
Returns
Type Description
Func<Vector3, Matrix4x4>
In this article
Back to top Generated by DocFX