Package com.j3d.engine.scene.nodes.util
Class Sampler
java.lang.Object
com.j3d.engine.scene.nodes.util.Sampler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidjoinNGonArbitaryVectors(ArrayList<Vector3> vector3list, Graphics2D g) Generates a list of Vector3 points forming a regular N-gon (polygon) on a specified axisPlane.static <T> ArrayList<T> Generates a list of points forming a regular N-gon (polygon) on a specified axisPlane.
-
Constructor Details
-
Sampler
public Sampler()
-
-
Method Details
-
ngon
public static <T> ArrayList<T> ngon(double radius, AxisPlane axisPlane, int n, Function<Vector3, T> mapper) Generates a list of points forming a regular N-gon (polygon) on a specified axisPlane. The points are generated by rotating a vector around the axisPlane's normal, starting from a given centre.- Type Parameters:
T- The type of objects to be returned in the list.- Parameters:
radius- The radius of the N-gon (distance from the centre to each vertex).axisPlane- The axisPlane on which the N-gon lies. This axisPlane will be normalised internally.n- The number of sides (and vertices) of the N-gon.mapper- A function to transform each generated Vector3 point into an object of type T.- Returns:
- An ArrayList of objects of type T, representing the vertices of the N-gon.
-
ngon
Generates a list of Vector3 points forming a regular N-gon (polygon) on a specified axisPlane. This is an overloaded method that directly returns Vector3 objects.- Parameters:
radius- The radius of the N-gon (distance from the centre to each vertex).axisPlane- The axisPlane on which the N-gon lies. This axisPlane will be normalised internally.n- The number of sides (and vertices) of the N-gon.- Returns:
- An ArrayList of Vector3 objects, representing the vertices of the N-gon.
-
joinNGonArbitaryVectors
-