Vector4 — Aspose.3D FOSS for Java

Enumerations

Vector4 एक डबल-प्रिसीजन 4-घटक वेक्टर है। यह मेष नियंत्रण बिंदुओं के लिए स्टोरेज प्रकार है (जहाँ w = 1.0 स्थितियों के लिए) और सामान्य डेटा के लिए VertexElementNormal परतों (जहाँ w उपयोग नहीं किया गया है)।.

Enumerations: com.aspose.threed

import com.aspose.threed.*;

Vector4 point = new Vector4(1.0, 2.0, 3.0, 1.0);

Enumerations

EnumerationsEnumerations
Vector4()Enumerations (0, 0, 0, 1)
Vector4(double x, double y, double z, double w)चार घटकों से निर्मित
Vector4(double x, double y, double z)के साथ निर्मित w = 1.0
Vector4(Vector3 v3)एक से निर्मित Vector3 के साथ w = 1.0
Vector4(Vector4 other)कॉपी कंस्ट्रक्टर

सार्वजनिक फ़ील्ड्स

Vector4 उपयोग करता है सार्वजनिक फ़ील्ड्स घटक पहुंच के लिए (गेटर/सेटर मेथड्स नहीं):

EnumerationsEnumerationsEnumerationsEnumerations
xdoublev.xX घटक
ydoublev.yY घटक
zdoublev.zZ घटक
wdoublev.wW घटक (समरूप निर्देशांक)

Enumerations

Enumerationsरिटर्न टाइपEnumerations
set(double x, double y, double z, double w)voidसभी चार घटकों को सेट करता है
toVector3()Vector3एक लौटाता है Vector3(x, y, z) छोड़ते हुए w घटक

Enumerations

import com.aspose.threed.*;

Mesh mesh = new Mesh();

// Add control points (w=1.0 for positions)
mesh.getControlPoints().add(new Vector4(0.0, 0.0, 0.0, 1.0));
mesh.getControlPoints().add(new Vector4(1.0, 0.0, 0.0, 1.0));
mesh.getControlPoints().add(new Vector4(0.5, 1.0, 0.0, 1.0));
mesh.createPolygon(0, 1, 2);

// Convert to Vector3
Vector4 v4 = new Vector4(1.0, 2.0, 3.0, 1.0);
Vector3 v3 = v4.toVector3();   // Vector3(1.0, 2.0, 3.0)

// Construct from Vector3
Vector3 pos = new Vector3(5.0, 0.0, 0.0);
Vector4 homogeneous = new Vector4(pos);   // w = 1.0

संबंधित देखें

 हिन्दी