SFVec3d
The SFVec3d object corresponds to an X3D SFVec3d field.
Each component of the vector can be accessed using the x, y and z properties or using C-style array dereferencing (i.e., v[0], v[1] or v[2]).
Properties
| Type | Property | Description | Standard |
|---|---|---|---|
| number | x | First value of the vector.
| X3D2.0 |
| number | y | Second value of the vector.
| X3D2.0 |
| number | z | Third value of the vector.
| X3D2.0 |
Functions
| Return type | Function | Description | Standard |
|---|---|---|---|
| SFVec3d(number x, number y.number z) |
Constructs a new SFVec3d object initialized to the values of Missing values default to 0.0. | ||
| SFVec3d | add(SFVec3d v) | Returns a new vector with the value of the passed value added, component-wise, to the object.
| X3D2.0 |
| SFVec3d | cross(SFVec3d vec) | Returns a new vector which is the cross product of the object and the passed value.
| X3D2.0 |
| SFVec3d | divide(numeric n) | Returns a new vector with the value of the object divided by the passed value.
| X3D2.0 |
| number | dot(SFVec3d v) | Returns the dot product of this vector and the passed value.
| X3D2.0 |
| number | length() | Returns the geometric length of this vector.
| X3D2.0 |
| SFVec3d | multiply(numeric n) | Returns a new vector with the value of the object multiplied by the passed value.
| X3D2.0 |
| SFVec3d | negate() | Returns a new vector which is the component-wise negation of the object.
| X3D2.0 |
| SFVec3d | normalize() | Returns a new vector with the value of object converted to unit length.
| X3D2.0 |
| SFVec3d | subtract(SFVec3d v) | Returns a new vector with the value of the passed value subtracted, component-wise, from the object.
| X3D2.0 |
| String | toString() | Returns a String containing the value of x, y, and z encoded using the X3D Classic VRML encoding.
| X3D2.0 |