Vector4

Phương pháp

Aspose.ThreeD.Utilities.Vector4 là một độ chính xác double 4-component vector. It is the type used by Mesh.ControlPoints (IList<Aspose.ThreeD.Utilities.Vector4>), PbrMaterial.BaseColor, LambertMaterial.Diffuse, và các API hình học và vật liệu khác. Các w thành phần thường 1.0 cho các vị trí Cartesian tiêu chuẩn.

using Aspose.ThreeD.Utilities;

var point = new Vector4(1.0, 2.0, 3.0, 1.0);
mesh.ControlPoints.Add(point);

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

  • Aspose.ThreeD.Utilities.Vector4độ chính xác kép, các trường x, y, z, w (chữ thường). Đây là kiểu được sử dụng cho Mesh.ControlPoints và các thuộc tính màu vật liệu.
  • Aspose.ThreeD.Vector4số thực đơn độ chính xác, các trường X, Y, Z, W (chữ hoa). Được sử dụng nội bộ. Thêm kiểu này vào ControlPoints sẽ gây ra lỗi biên dịch.

Methods using Aspose.ThreeD.Utilities; khi làm việc với các điểm điều khiển hình học hoặc dữ liệu vật liệu.

Phương pháp

NameTypeAccessDescription
LengthdoubleReadGets the length.
SignatureDescription
Vector4(vec: Vector3, w: double)Creates a new 4‑dimensional vector with the given x, y, z, and w components
Vector4(vec: Vector3)
Vector4(vec: FVector4)
Vector4(x: double, y: double, z: double)
Vector4(x: double, y: double, z: double, w: double)
Set(newX: double, newY: double, newZ: double)Updates the X, Y, and Z components of the vector
Set(newX: double, newY: double, newZ: double, newW: double)
Equals(obj: object)Determines whether another Vector4 has the same component values
GetHashCode()
ToString()
CompareTo(other: Vector4)Compares this vector with another Vector4 for ordering

Xem thêm

 Tiếng Việt