Point3D#
Added in version 1.0.
- class Point3D(*args, **kwargs)#
A point with three components: X, Y, and Z.
Constructors#
Methods#
- class Point3D
- cross(b: Point3D) Point3D #
Computes the cross product of the two given
Point3D
.Added in version 1.0.
- Parameters:
b – a
Point3D
- distance(b: Point3D) Tuple[float, Vec3] #
Computes the distance between the two given
Point3D
.Added in version 1.4.
- Parameters:
b – a
Point3D
- dot(b: Point3D) float #
Computes the dot product of the two given
Point3D
.Added in version 1.0.
- Parameters:
b – a
Point3D
- equal(b: Point3D) bool #
Checks whether two given points are equal.
Added in version 1.0.
- Parameters:
b – a
Point3D
- init(x: float, y: float, z: float) Point3D #
Initializes a
Point3D
with the given coordinates.Added in version 1.0.
- Parameters:
x – the X coordinate of the point
y – the Y coordinate of the point
z – the Z coordinate of the point
- init_from_point(src: Point3D) Point3D #
Initializes a
Point3D
using the coordinates of anotherPoint3D
.Added in version 1.0.
- Parameters:
src – a
Point3D
- init_from_vec3(v: Vec3) Point3D #
Initializes a
Point3D
using the components of aVec3
.Added in version 1.0.
- Parameters:
v – a
Vec3
- interpolate(b: Point3D, factor: float) Point3D #
Linearly interpolates each component of
a
andb
using the providedfactor
, and places the result inres
.Added in version 1.0.
- Parameters:
b – a
Point3D
factor – the interpolation factor
- length() float #
Computes the length of the vector represented by the coordinates of the given
Point3D
.Added in version 1.0.
- near(b: Point3D, epsilon: float) bool #
Checks whether the two points are near each other, within an
epsilon
factor.Added in version 1.0.
- Parameters:
b – a
Point3D
epsilon – fuzzyness factor
- normalize() Point3D #
Computes the normalization of the vector represented by the coordinates of the given
Point3D
.Added in version 1.0.
- normalize_viewport(viewport: Rect, z_near: float, z_far: float) Point3D #
Normalizes the coordinates of a
Point3D
using the given viewport and clipping planes.The coordinates of the resulting
Point3D
will be in the [ -1, 1 ] range.Added in version 1.4.
- Parameters:
viewport – a
Rect
representing a viewportz_near – the coordinate of the near clipping plane, or 0 for the default near clipping plane
z_far – the coordinate of the far clipping plane, or 1 for the default far clipping plane