FVector3 / FVector4

FVector3, FVector4 — Aspose.3D FOSS for Java

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

Example FVector perhe tarjoaa yksittäistarkkuus (float) vaihtoehtoja kaksoistarkkuudelle Vector tyyppejä. Niitä käytetään sisäisesti vertex-elementtien data-taulukoissa normaalien, tangenttien ja UV-koordinaattien tiiviiseen tallennukseen.

Huomautus: FVector2 ei ole olemassa versiossa Java. Vain FVector3 ja FVector4 ovat saatavilla.


FVector3

Yksittäistarkkuuden 3-komponenttinen float-vektori. Esiintyy vertex-elementtien tietotauluissa normaalien ja tangenttien osalta.

Example

ExampleExample
FVector3()Example (0, 0, 0)
FVector3(float x, float y, float z)Rakenteet kolmesta komponentista
FVector3(Vector3 v)Rakenteet kaksoistarkkuudesta Vector3

Julkiset kentät

FVector3 käyttää julkiset kentät komponenttien käyttöön:

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

Example

ExamplePalautustyyppiExample
normalize()FVector3Palauttaa yksikköpituuden kopion
cross(FVector3 rhs)FVector3Ristitulo
dot(FVector3 rhs)floatPistetulo

FVector4

Yhden tarkkuuden 4-komponenttinen float-vektori. Tietojen tallennustyyppi VertexElementFVector tietoja.

Example

ExampleExample
FVector4()Example (0, 0, 0, 0)
FVector4(float x, float y, float z, float w)Rakentaa neljästä komponentista
FVector4(Vector4 v)Rakentaa kaksoistarkkuudesta Vector4

Julkiset kentät

FVector4 käyttää julkisia kenttiä komponenttien käyttöön:

ExampleExampleExampleExample
xfloatv.xX-komponentti
yfloatv.yY-komponentti
zfloatv.zZ-komponentti
wfloatv.wW-komponentti

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

Katso myös

 Suomi