实施“瀑布” Java模拟

发布于 2024-12-05 00:28:20 字数 361 浏览 2 评论 0原文

我想实现此视频的可视化 在 Java 中作为经验帮助我理解创建可视化过程中的所有“麻烦”。我有一些 OpenGL 经验,并且对如何处理所涉及的物理有很好的理解。然而,如果有人知道任何好的游戏引擎可能会有所帮助(或者至少完成创建上述可视化内容所涉及的一些繁重工作),我将不胜感激。

另外,我注意到链接的视频必须使用许多单独的喷射器才能按其方式运行。它有可能是使用较低级别的东西(例如 C)创建的吗?是否可以使用Java这样的高级语言来控制这样的系统?

I would like to implement a visualisation of this video in Java as experience to help me understand all of the 'troubles' in creating visualisations. I have some experience in OpenGL, and a good understanding of how to handle the physics involved. However, if anybody knows of any good game engines that may help (or at least do some of the heavy lifting involved in creating a visualisation of the above) I would be grateful.

Also, I noticed that the linked video must use many separate jets in order to operate in the way it does. Is it likely that it was created using something a little lower level such as C? Is it possible to use a higher level language like Java to control such a system?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清泪尽 2024-12-12 00:28:20

老实说,如果你想实现“仅此而已”,我认为使用游戏引擎就有点矫枉过正了。只需自己实现一个简单的粒子引擎就可以了。

说实话,这个问题并不难,任何语言都可以解决。其背后的基本原理与蒸汽风琴或自弹钢琴相同。您有一个输入数据,显示要播放的模式是什么,并且您可以在给定时间内推进它。

这是我构建基本控制系统的方法。您拍摄一张黑白图像。宽度恰好与“发射器”的数量一样宽,长度与图案需要的长度一样长。您阅读图像并从第一行开始。您遍历该行中的每个像素,如果像素是黑色的,您会发射一滴水,如果像素是白色的,则不会。然后,您以给定的间隔(可能是 25 毫秒)移动到下一行并相应地设置发射器。

图像的最酷之处在于您可以简单地在任何图形程序中绘制它们。要获得当前时间,您可以将时间渲染到内存中的图像缓冲区中,然后将其传递到上面的代码中。 (如果你喜欢的话,你甚至可以获得字体......)

Honestly, if you want to implement "just that", I think using a game engine is overkill. Just implement a simple particle engine on your own and you are done.

Seriously, that problem is not so difficult, any language can be used for it. The basic principle behind it is the same as behind steam organs or self player pianos. You have an input data that shows what the pattern to play is and you advance it in a given time.

Here is how I would build the basic control system. You take a black and white image. The width is exactly as wide as the number of "emitters" and the length is as long as the pattern needs to be. You read the image and start at the first line. You walk through each pixel in that line and if the pixel is black you emit a drop and if the pixel is white you don't. You then move in a given interval (maybe 25ms) to the next line and set the emitters accordingly.

The cool thing with images is that you can simply paint them in any graphic program. To get the current time to work you render the time into a image buffer in memory, then pass that into the above code. (You even get fonts if you like...)

薄情伤 2024-12-12 00:28:20

您可以使用jMonkeyEngine

JAVA OPEN GL 游戏引擎

You can use jMonkeyEngine.

JAVA OPEN GL GAME ENGINE

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文