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 エディションで。のみ FVector3FVector4 利用可能です。.


FVector3

単精度 3 成分浮動小数点ベクトル。法線と接線の頂点要素データ配列に現れます。.

Example

ExampleExample
FVector3()Example (0, 0, 0)
FVector3(float x, float y, float z)3つのコンポーネントから構成されます
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 成分の float ベクトル。ストレージ型は VertexElementFVector データ。.

Example

ExampleExample
FVector4()Example (0, 0, 0, 0)
FVector4(float x, float y, float z, float w)4 つの成分から構築
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

参照

 日本語