Coming from an Android development background into a PC-gaming environment, I’m looking for something similar to Android’s Path class. However, the Android path class is 2d, and I need a 3d (circular) path. Specifically, I’m preparing a space-like simulation and need to emulate an “orbit.”
Does Java have a path class? If not, is there an API for 3d paths (circular or non)?
Take a look into GeneralPath and Java3D PathInterpolator
From the Java6SE release notes….
“For a long time the Java 2D API lacked a double version of the GeneralPath class. The Path2D class represents a path that can be iterated by the PathIterator interface and has two subclasses: Path2D.Float and Path2D.Double. In the changed hierarchy, the GeneralPath class became a subclass of the Path2D.Float class. They both can be used for single point precision, while the Path2D.Double class can be applied for double point precision. One reason to use the Path2D.Float class over the GeneralPath class is to make your code more consistence and explicit if both single and double precision types are employed in the application.”
From Java3D :
http://download.java.net/media/java3d/javadoc/1.3.2/javax/media/j3d/PathInterpolator.html
These examples might not hurt either:
http://java.sun.com/products/java-media/2D/samples/suite/