Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Point3D

[11:7] extends: FxObj

Wraps JavaFX Point3D, an immutable 3D coordinate or vector with double precision X, Y, and Z components. Used throughout the JavaFX 3D API for positions, axes, and vector math. Point3D is the standard way to express 3D positions for cameras, lights, custom shapes, and rotation axes.

Methods

  • Point3D (X = null, Y = null, Z = null)

    Creates a new Point3D with the given X, Y, and Z values.

    • @p X is a double with the X coordinate.
    • @p Y is a double with the Y coordinate.
    • @p Z is a double with the Z coordinate.
  • getX ()

    Returns the X component of this point.

    • @r A double with the X value.
  • getY ()

    Returns the Y component of this point.

    • @r A double with the Y value.
  • getZ ()

    Returns the Z component of this point.

    • @r A double with the Z value.
  • magnitude ()

    Returns the magnitude (length) of this point treated as a vector.

    • @r A double with the magnitude.
  • distance (object Other)

    Returns the distance from this point to the given point.

    • @p Other is a Point3D with the target point.
    • @r A double with the distance.
  • normalize ()

    Returns a new normalized (unit length) Point3D in the same direction.

    • @r A new Point3D with unit length.
  • dotProduct (object Other)

    Returns the dot product of this point and the given point.

    • @p Other is a Point3D for the operand.
    • @r A double with the dot product.
  • crossProduct (object Other)

    Returns the cross product of this point and the given point as a new Point3D.

    • @p Other is a Point3D for the operand.
    • @r A new Point3D with the cross product.
  • xAxis ()

    Returns the standard X axis unit vector (1, 0, 0) as a Point3D.

    • @r A new Point3D with the X axis vector.
  • yAxis ()

    Returns the standard Y axis unit vector (0, 1, 0) as a Point3D.

    • @r A new Point3D with the Y axis vector.
  • zAxis ()

    Returns the standard Z axis unit vector (0, 0, 1) as a Point3D.

    • @r A new Point3D with the Z axis vector.
  • distanceXYZ (double X, double Y, double Z)

    Returns the distance from this point to the point (X, Y, Z). Wraps the distance(double, double, double) overload of Point3D.

    • @p X is a double with the target X coordinate.
    • @p Y is a double with the target Y coordinate.
    • @p Z is a double with the target Z coordinate.
    • @r A double with the distance.
  • addXYZ (double X, double Y, double Z)

    Returns a new Point3D that is the sum of this point and (X, Y, Z). Wraps the add(double, double, double) overload of Point3D.

    • @p X is a double added to this point's X coordinate.
    • @p Y is a double added to this point's Y coordinate.
    • @p Z is a double added to this point's Z coordinate.
    • @r A new Point3D with the sum.
  • add (object Other)

    Returns a new Point3D that is the sum of this point and Other. Wraps the add(Point3D) overload of Point3D.

    • @p Other is a Point3D added to this point.
    • @r A new Point3D with the sum.
  • subtractXYZ (double X, double Y, double Z)

    Returns a new Point3D that is this point minus (X, Y, Z). Wraps the subtract(double, double, double) overload of Point3D.

    • @p X is a double subtracted from this point's X coordinate.
    • @p Y is a double subtracted from this point's Y coordinate.
    • @p Z is a double subtracted from this point's Z coordinate.
    • @r A new Point3D with the difference.
  • subtract (object Other)

    Returns a new Point3D that is this point minus Other. Wraps the subtract(Point3D) overload of Point3D.

    • @p Other is a Point3D subtracted from this point.
    • @r A new Point3D with the difference.
  • multiply (double Factor)

    Returns a new Point3D that is this point scaled by Factor.

    • @p Factor is a double scaling factor.
    • @r A new Point3D with each component multiplied by Factor.
  • midpointXYZ (double X, double Y, double Z)

    Returns a new Point3D at the midpoint between this point and (X, Y, Z). Wraps the midpoint(double, double, double) overload.

    • @p X is a double with the target X coordinate.
    • @p Y is a double with the target Y coordinate.
    • @p Z is a double with the target Z coordinate.
    • @r A new Point3D at the midpoint.
  • midpoint (object Other)

    Returns a new Point3D at the midpoint between this point and Other. Wraps the midpoint(Point3D) overload.

    • @p Other is a Point3D at the other end of the segment.
    • @r A new Point3D at the midpoint.
  • angleXYZ (double X, double Y, double Z)

    Returns the angle in degrees between this vector and the vector (X, Y, Z). Wraps the angle(double, double, double) overload.

    • @p X is a double with the target X coordinate.
    • @p Y is a double with the target Y coordinate.
    • @p Z is a double with the target Z coordinate.
    • @r A double with the angle in degrees.
  • angle (object Other)

    Returns the angle in degrees between this vector and Other. Wraps the angle(Point3D) overload.

    • @p Other is a Point3D.
    • @r A double with the angle in degrees.
  • angleBetween (object P1, object P2)

    Returns the angle in degrees between the vector (P1 - this) and the vector (P2 - this). Wraps the angle(Point3D, Point3D) overload.

    • @p P1 is a Point3D, the first vector endpoint.
    • @p P2 is a Point3D, the second vector endpoint.
    • @r A double with the angle in degrees.
  • dotProductXYZ (double X, double Y, double Z)

    Returns the dot product of this point and (X, Y, Z). Wraps the dotProduct(double, double, double) overload.

    • @p X is a double with the target X coordinate.
    • @p Y is a double with the target Y coordinate.
    • @p Z is a double with the target Z coordinate.
    • @r A double with the dot product.
  • crossProductXYZ (double X, double Y, double Z)

    Returns the cross product of this point and (X, Y, Z) as a new Point3D. Wraps the crossProduct(double, double, double) overload.

    • @p X is a double with the target X coordinate.
    • @p Y is a double with the target Y coordinate.
    • @p Z is a double with the target Z coordinate.
    • @r A new Point3D with the cross product.
  • interpolate (object Other, double Frac)

    Linearly interpolates between this point and Other by Frac. Frac 0.0 returns this point and 1.0 returns Other.

    • @p Other is a Point3D at the end of the interpolation.
    • @p Frac is a double interpolation factor in the range 0.0 to 1.0.
    • @r A new Point3D at the interpolated position.