Vector3

Phương pháp

Aspose.ThreeD.Utilities.Vector3 là một độ chính xác kép 3-component vector used throughout the library for geometry coordinates, positions, directions, and material values. Fields are lowercase: x, y, z.

using Aspose.ThreeD.Utilities;

var a = new Vector3(1.0, 0.0, 0.0);
var b = new Vector3(0.0, 1.0, 0.0);

Phân biệt không gian tên: Hai riêng biệt Vector3 các struct tồn tại trong thư viện này:

  • Aspose.ThreeD.Utilities.Vector3độ chính xác double, các trường x, y, z (lowercase). Được sử dụng cho hình học, màu vật liệu và hầu hết các giao diện API công cộng.
  • Aspose.ThreeD.Vector3float đơn độ chính xác, các trường X, Y, Z (uppercase). Được sử dụng nội bộ bởi lớp render. Không phải là kiểu mà Mesh.ControlPoints hoặc các thuộc tính vật liệu.

Methods using Aspose.ThreeD.Utilities; khi làm việc với hình học hoặc vật liệu.

Phương pháp

NameTypeAccessDescription
ItemdoubleRead/WriteGets or sets the item.
Length2doubleReadGets the length2.
LengthdoubleReadGets the length.
ZeroVector3ReadGets the zero.
OneVector3ReadGets the one.
UnitXVector3ReadGets the unit x.
UnitYVector3ReadGets the unit y.
UnitZVector3ReadGets the unit z.
SignatureDescription
Vector3(x: double, y: double, z: double)Creates a vector from a Vector4, discarding the w component
Vector3(vec: FVector3)
Vector3(v: double)
Vector3(vec4: Vector4)
Parse(input: string)Converts a string representation into a Vector3
Equals(obj: object)Determines whether the given object is equal to this vector
GetHashCode()
Dot(rhs: Vector3)Returns the dot product of this vector with another
Normalize()Scales the vector to unit length
Sin()Returns a vector of the sine of each component
Cos()Returns a vector of the cosine of each component
Cross(rhs: Vector3)
Set(newX: double, newY: double, newZ: double)Assigns new x, y, z values to the vector
ToString()Returns a string representation of the vector
AngleBetween(dir: Vector3, up: Vector3)Computes the signed angle to dir using up as reference
AngleBetween(dir: Vector3)
CompareTo(other: Vector3)Compares this vector to another for sorting

Xem thêm

 Tiếng Việt