FVector3, FVector4 — Aspose.3D FOSS for Java
पैकेज: com.aspose.threed (aspose-3d-foss 26.1.0)
Example FVector परिवार सिंगल-प्रिसीजन (float) डबल-प्रिसीजन के विकल्प Vector प्रकार। इन्हें वर्टेक्स एलिमेंट डेटा एरेज़ द्वारा सामान्य, टैन्जेंट और यूवी कॉर्डिनेट्स के कॉम्पैक्ट स्टोरेज के लिए आंतरिक रूप से उपयोग किया जाता है।.
नोट: 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) | डबल-प्रिसीजन से बनाता है Vector4 |
सार्वजनिक फ़ील्ड्स
FVector4 उपयोग करता है सार्वजनिक फ़ील्ड्स घटक पहुँच के लिए:
| 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