jme3 / Java 3d 路径实现?
从 Android 开发背景进入 PC 游戏环境,我正在寻找类似于 Android 的 Path 类。但是,Android 路径类是 2d,我需要一个 3d(圆形)路径。具体来说,我正在准备一个类似太空的模拟,并且需要模拟一个“轨道”。
Java有路径类吗?如果没有,是否有 3D 路径(圆形或非圆形)的 API?
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)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
Java6SE 发行说明中的 GeneralPath 和 Java3D PathInterpolator...
“很长一段时间,Java 2D API 缺乏 GeneralPath 类的双重版本。Path2D 类表示可以通过 PathIterator 接口迭代的路径,并且有两个子类:Path2D.Float 和 Path2D.Double。在更改的层次结构中,GeneralPath 类成为 Path2D.Float 类的子类,它们都可以用于单点。精度,而 Path2D.Double 类可应用于双点精度。使用 Path2D.Float 类而不是 GeneralPath 类的原因之一是,如果应用程序中同时使用单精度和双精度类型,则可以使代码更加一致和明确。 ”。
来自Java3D:
http://download.java.net /media/java3d/javadoc/1.3.2/javax/media/j3d/PathInterpolator.html
这些示例可能也不会造成伤害:
http://java.sun.com/products/java-media/ 2D/样本/套件/
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/