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
Point3Dwith 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
Point3Dusing the coordinates of anotherPoint3D.Added in version 1.0.
- Parameters:
src – a
Point3D
- init_from_vec3(v: Vec3) Point3D#
Initializes a
Point3Dusing the components of aVec3.Added in version 1.0.
- Parameters:
v – a
Vec3
- interpolate(b: Point3D, factor: float) Point3D#
Linearly interpolates each component of
aandbusing the providedfactor, and places the result inres.Added in version 1.0.
- Parameters:
b – a
Point3Dfactor – 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
epsilonfactor.Added in version 1.0.
- Parameters:
b – a
Point3Depsilon – 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
Point3Dusing the given viewport and clipping planes.The coordinates of the resulting
Point3Dwill be in the [ -1, 1 ] range.Added in version 1.4.
- Parameters:
viewport – a
Rectrepresenting 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