FVector3 / FVector4

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

ExampleExample
FVector3()Example (0, 0, 0)
FVector3(float x, float y, float z)세 구성 요소로 구성
FVector3(Vector3 v)배정밀도에서 구성 Vector3

공용 필드

FVector3 사용한다 공개 필드 구성 요소 접근을 위해:

ExampleExampleExampleExample
xfloatv.xX 구성 요소
yfloatv.yY 구성 요소
zfloatv.zZ 성분

Example

Example반환 유형Example
normalize()FVector3단위 길이 복사본을 반환합니다
cross(FVector3 rhs)FVector3외적
dot(FVector3 rhs)float내적

FVector4

단정밀도 4-컴포넌트 부동소수점 벡터. 저장 유형은 VertexElementFVector 데이터.

Example

ExampleExample
FVector4()Example (0, 0, 0, 0)
FVector4(float x, float y, float z, float w)네 개의 구성 요소로부터 구성합니다
FVector4(Vector4 v)double-precision에서 생성 Vector4

공용 필드

FVector4 사용 public 필드 구성 요소 접근을 위해:

ExampleExampleExampleExample
xfloatv.xX 구성 요소
yfloatv.yY 구성 요소
zfloatv.zZ 구성 요소
wfloatv.wW 구성 요소

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

참고

 한국어