FVector3, FVector4 — Aspose.3D FOSS for Java
패키지: com.aspose.threed (aspose-3d-foss 26.1.0)
Example FVector 패밀리는 단정밀도 (float) 이중 정밀도에 대한 대안 Vector 형식입니다. 이들은 정점 요소 데이터 배열에서 노멀, 탄젠트 및 UV 좌표를 압축 저장하기 위해 내부적으로 사용됩니다.
참고: FVector2 한다 존재하지 않음 Java 에디션에서. 오직 FVector3 그리고 FVector4 사용 가능하다.
FVector3
단정밀도 3컴포넌트 부동소수점 벡터. 정점 요소 데이터 배열에서 법선 및 탄젠트에 나타납니다.
Example
| Example | Example |
|---|---|
FVector3() | Example (0, 0, 0) |
FVector3(float x, float y, float z) | 세 구성 요소로 구성 |
FVector3(Vector3 v) | 배정밀도에서 구성 Vector3 |
공용 필드
FVector3 사용한다 공개 필드 구성 요소 접근을 위해:
| Example | Example | Example | Example |
|---|---|---|---|
x | float | v.x | X 구성 요소 |
y | float | v.y | Y 구성 요소 |
z | float | v.z | Z 성분 |
Example
| Example | 반환 유형 | Example |
|---|---|---|
normalize() | FVector3 | 단위 길이 복사본을 반환합니다 |
cross(FVector3 rhs) | FVector3 | 외적 |
dot(FVector3 rhs) | float | 내적 |
FVector4
단정밀도 4-컴포넌트 부동소수점 벡터. 저장 유형은 VertexElementFVector 데이터.
Example
| Example | Example |
|---|---|
FVector4() | Example (0, 0, 0, 0) |
FVector4(float x, float y, float z, float w) | 네 개의 구성 요소로부터 구성합니다 |
FVector4(Vector4 v) | double-precision에서 생성 Vector4 |
공용 필드
FVector4 사용 public 필드 구성 요소 접근을 위해:
| Example | Example | Example | Example |
|---|---|---|---|
x | float | v.x | X 구성 요소 |
y | float | v.y | Y 구성 요소 |
z | float | v.z | Z 구성 요소 |
w | float | v.w | W 구성 요소 |
Example
import com.aspose.threed.*;
// Create from components
FVector3 normal = new FVector3(0.0f, 1.0f, 0.0f);
// Convert from double-precision
Vector3 dir = new Vector3(3.0, 4.0, 0.0);
FVector3 fDir = new FVector3(dir);
// Normalize
FVector3 unit = fDir.normalize();
System.out.println(unit.x); // 0.6f
System.out.println(unit.y); // 0.8f