FVector3 / FVector4

FVector3, FVector4 — Aspose.3D FOSS for Java

Paket: com.aspose.threed (aspose-3d-foss 26.1.0)

Example FVector Familie bietet Einzelpräzision (float) Alternativen zur Doppelpräzision Vector Typen. Sie werden intern von Vertex-Element-Datenarrays für die kompakte Speicherung von Normalen, Tangenten und UV-Koordinaten verwendet.

Hinweis: FVector2 gibt nicht existieren in der Java Ausgabe. Nur FVector3 und FVector4 sind verfügbar.


FVector3

Einzelpräzisions‑3‑Komponenten‑Float‑Vektor. Er erscheint in Vertex‑Elementdaten‑Arrays für Normalen und Tangenten.

Example

ExampleExample
FVector3()Example (0, 0, 0)
FVector3(float x, float y, float z)Konstrukte aus drei Komponenten
FVector3(Vector3 v)Konstrukte aus einer doppelten Genauigkeit Vector3

Öffentliche Felder

FVector3 verwendet öffentliche Felder für den Zugriff auf Komponenten:

ExampleExampleExampleExample
xfloatv.xX‑Komponente
yfloatv.yY‑Komponente
zfloatv.zZ‑Komponente

Example

ExampleRückgabetypExample
normalize()FVector3Gibt eine Kopie mit Einheitslänge zurück
cross(FVector3 rhs)FVector3Kreuzprodukt
dot(FVector3 rhs)floatSkalarprodukt

FVector4

Einzelpräzisions-4-Komponenten-Float-Vektor. Der Speichertyp von VertexElementFVector Daten.

Example

ExampleExample
FVector4()Example (0, 0, 0, 0)
FVector4(float x, float y, float z, float w)Konstruiert aus vier Komponenten
FVector4(Vector4 v)Konstruiert aus einer Doppelpräzision Vector4

Öffentliche Felder

FVector4 verwendet öffentliche Felder für den Komponenten‑Zugriff:

ExampleExampleExampleExample
xfloatv.xX‑Komponente
yfloatv.yY‑Komponente
zfloatv.zZ‑Komponente
wfloatv.wW‑Komponente

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

Siehe auch

 Deutsch