Graphene.Point3D¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
x |
r/w |
the X coordinate |
|
y |
r/w |
the Y coordinate |
|
z |
r/w |
the Z coordinate |
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Graphene.Point3D¶
A point with three components: X, Y, and Z.
New in version 1.0.
- classmethod alloc()¶
- Returns:
the newly allocated structure. Use
Graphene.Point3D.free
() to free the resources allocated by this function.- Return type:
Allocates a
Graphene.Point3D
structure.New in version 1.0.
- classmethod zero()¶
- Returns:
a zero point
- Return type:
Retrieves a constant point with all three coordinates set to 0.
New in version 1.0.
- cross(b)¶
- Parameters:
b (
Graphene.Point3D
) – aGraphene.Point3D
- Returns:
return location for the cross product
- Return type:
res:
Graphene.Point3D
Computes the cross product of the two given
Graphene.Point3D
.New in version 1.0.
- distance(b)¶
- Parameters:
b (
Graphene.Point3D
) – aGraphene.Point3D
- Returns:
the distance between two points
- delta:
return location for the distance components on the X, Y, and Z axis
- Return type:
(
float
, delta:Graphene.Vec3
)
Computes the distance between the two given
Graphene.Point3D
.New in version 1.4.
- dot(b)¶
- Parameters:
b (
Graphene.Point3D
) – aGraphene.Point3D
- Returns:
the value of the dot product
- Return type:
Computes the dot product of the two given
Graphene.Point3D
.New in version 1.0.
- equal(b)¶
- Parameters:
b (
Graphene.Point3D
) – aGraphene.Point3D
- Returns:
true
if the points are equal- Return type:
Checks whether two given points are equal.
New in version 1.0.
- free()¶
Frees the resources allocated via
Graphene.Point3D.alloc
().New in version 1.0.
- init(x, y, z)¶
- Parameters:
- Returns:
the initialized
Graphene.Point3D
- Return type:
Initializes a
Graphene.Point3D
with the given coordinates.New in version 1.0.
- init_from_point(src)¶
- Parameters:
src (
Graphene.Point3D
) – aGraphene.Point3D
- Returns:
the initialized point
- Return type:
Initializes a
Graphene.Point3D
using the coordinates of anotherGraphene.Point3D
.New in version 1.0.
- init_from_vec3(v)¶
- Parameters:
v (
Graphene.Vec3
) – aGraphene.Vec3
- Returns:
the initialized
Graphene.Point3D
- Return type:
Initializes a
Graphene.Point3D
using the components of aGraphene.Vec3
.New in version 1.0.
- interpolate(b, factor)¶
- Parameters:
b (
Graphene.Point3D
) – aGraphene.Point3D
factor (
float
) – the interpolation factor
- Returns:
the return location for the interpolated
Graphene.Point3D
- Return type:
res:
Graphene.Point3D
Linearly interpolates each component of self and b using the provided factor, and places the result in res.
New in version 1.0.
- length()¶
- Returns:
the length of the vector represented by the point
- Return type:
Computes the length of the vector represented by the coordinates of the given
Graphene.Point3D
.New in version 1.0.
- near(b, epsilon)¶
- Parameters:
b (
Graphene.Point3D
) – aGraphene.Point3D
epsilon (
float
) – fuzzyness factor
- Returns:
true
if the points are near each other- Return type:
Checks whether the two points are near each other, within an epsilon factor.
New in version 1.0.
- normalize()¶
- Returns:
return location for the normalized
Graphene.Point3D
- Return type:
res:
Graphene.Point3D
Computes the normalization of the vector represented by the coordinates of the given
Graphene.Point3D
.New in version 1.0.
- normalize_viewport(viewport, z_near, z_far)¶
- Parameters:
viewport (
Graphene.Rect
) – aGraphene.Rect
representing a viewportz_near (
float
) – the coordinate of the near clipping plane, or 0 for the default near clipping planez_far (
float
) – the coordinate of the far clipping plane, or 1 for the default far clipping plane
- Returns:
the return location for the normalized
Graphene.Point3D
- Return type:
res:
Graphene.Point3D
Normalizes the coordinates of a
Graphene.Point3D
using the given viewport and clipping planes.The coordinates of the resulting
Graphene.Point3D
will be in the [ -1, 1 ] range.New in version 1.4.
- scale(factor)¶
- Parameters:
factor (
float
) – the scaling factor- Returns:
return location for the scaled point
- Return type:
res:
Graphene.Point3D
Scales the coordinates of the given
Graphene.Point3D
by the given factor.New in version 1.0.
- to_vec3()¶
- Returns:
return location for a
Graphene.Vec3
- Return type:
Stores the coordinates of a
Graphene.Point3D
into aGraphene.Vec3
.New in version 1.0.