用 Java 编写 3d 游戏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5572816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 11:43:17  来源:igfitidea点击:

3d game programming in Java

java3d

提问by Alex

I recently agreed to help a friend make a game he has been working on and I decided that I would prefer to write it in Java. I am unsure what the best route is to take for 3D in Java. I have found that most everyone talks about Java 3dfor 3d graphics in Java, which seems to basically be a wrapper for Directxand openGLbut I have also found that Java 3dhasn't been in active development since 2008. Is it still the best thing to use or is there something with more active development that would be better. I have seen some discussion about some other APIs but Java 3dseems to have better documentation and there are some fairly decent books on 3d programming in Java that all seem to be based on Java 3d.

我最近同意帮助一位朋友制作他一直在开发的游戏,我决定更愿意用 Java 编写它。我不确定在 Java 中使用 3D 的最佳途径是什么。我发现大多数人都在谈论Java 3dJava 中的 3d 图形,这似乎基本上是一个包装器DirectxopenGL但我也发现它Java 3d自 2008 年以来一直没有积极开发。它仍然是最好的使用还是有一些更积极的发展会更好。我看过一些关于其他 API 的讨论,但Java 3d似乎有更好的文档,并且有一些相当不错的 Java 3d 编程书籍似乎都基于Java 3d.

采纳答案by DJClayworth

There are a number of options you have when writing 3D apps in Java.

在用 Java 编写 3D 应用程序时,您有许多选择。

  • JOGLis a very thin wrapper for OpenGL written in Java. Using it involves learning to program in OpenGL, which is no small undertaking. It does allow you to maximize your performance at the cost of a big increase in development time. If you happen to be familiar with OpenGL already , or need very low level functionality, this is your best choice.
  • Java3Dis an object oriented extensions to Java that is easier to use then JOGL and has the advantage of being supported by the Java community. It's less used than some of the other solutions.
  • LWJGL(Lightweight Java Game Library) is a is a library for making games in Java with 2D and 3D graphics, and it also supports sound (OpenAL), and provides many useful features for games development. It's less suitable for other 3D development.
  • There are a number of other game engines built on LWJGL and the other libraries that provide a greater range of features than any of the others. JMonkeyEngineis probably the frontrunner of these. They will provide more functionality for you in terms of view control, animation etc.
  • JOGL是一个用 Java 编写的非常薄的 OpenGL 包装器。使用它涉及学习在 OpenGL 中编程,这不是一件小事。它确实允许您以大大增加开发时间为代价来最大限度地提高性能。如果您碰巧已经熟悉 OpenGL,或者需要非常低级的功能,那么这是您的最佳选择。
  • Java3D是 Java 的面向对象扩展,它比 JOGL 更易于使用,并且具有受 Java 社区支持的优势。它比其他一些解决方案更少使用。
  • LWJGL(Lightweight Java Game Library) 是一个用 Java 制作 2D 和 3D 图形游戏的库,它还支持声音​​ (OpenAL),并为游戏开发提供了许多有用的功能。它不太适合其他 3D 开发。
  • 还有许多其他游戏引擎构建在 LWJGL 和其他库上,它们提供的功能范围比任何其他引擎都大。JMonkeyEngine可能是这些的领跑者。它们将在视图控制、动画等方面为您提供更多功能。

Which book you read entirely depends on which choice you make above.

你读哪本书完全取决于你在上面做出的选择。

回答by phihag

JOGLis a modern replacement under active development. It's basically just bindings to the OpenGL library.

JOGL是正在积极开发中的现代替代品。它基本上只是与 OpenGL 库的绑定。

回答by Jesper

Have a look at jMonkeyEngineand LWJGL.

看看jMonkeyEngineLWJGL

jMonkeyEngine is being actively developed and it includes a complete toolkit and IDE for creating 3D graphics applications in Java.

jMonkeyEngine 正在积极开发中,它包括一个完整的工具包和 IDE,用于在 Java 中创建 3D 图形应用程序。

LWJGL (Lightweight Java Game Library) is a library for making games in Java with 2D and 3D graphics, and it also supports sound (OpenAL).

LWJGL(轻量级 Java 游戏库)是一个用 Java 制作带有 2D 和 3D 图形的游戏的库,它还支持声音​​(OpenAL)。

回答by jhocking

I haven't checked it out in a while, but JMonkeyEngine was the best Java 3D engine around.

我有一段时间没有检查它了,但 JMonkeyEngine 是最好的 Java 3D 引擎。

回答by mbatchkarov

A friend used Processing a while ago and found it reasonable.

前段时间有朋友用过Processing,觉得合理。