这个动画 Java 小程序背后的算法

发布于 2024-08-06 00:40:56 字数 162 浏览 2 评论 0原文

我最近碰巧看到了这个动画(http://universe.daylife.com/)。我想知道这个小程序背后的算法是什么。如何以及在哪里学习这些东西?

谢谢

I was recently happened to see this animation (http://universe.daylife.com/). I was wondering what are the algorithms behind this applet. How and Where to learn such things?

Thanks

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

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

发布评论

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

评论(1

绿光 2024-08-13 00:40:56

嗯,有趣的是,我在 Java 控制台中遇到了很多异常,但它确实有效(改变颜色,但显然没有做太多其他工作)。

例外情况是:

java.lang.NullPointerException
    at universe.draw(universe.java:262)
    at processing.core.PApplet.handleDisplay(PApplet.java:1359)
    at processing.core.PGraphics.requestDisplay(PGraphics.java:680)
    at processing.core.PApplet.run(PApplet.java:1454)
    at java.lang.Thread.run(Unknown Source)

它至少揭示了小程序是如何完成的:通过使用优秀的 Processing环境(使用“简化的”Java 和良好的图形库)。

因为它对我来说并没有真正起作用,所以我很难告诉你它是如何完成的(它应该做什么?),但是好吧,你至少有一个起点!请注意,Processing 也提供了很好的教程...

[编辑]我重新尝试了标准搜索词(New-York 而不是 JavaFX...),并得到了一些结果。相当令人印象深刻。
显然,那里已经投入了大量的工作。
我确认您可以通过浏览(和交互!)处理站点和论坛来学习很多关于那里使用的算法(图形、网络、数据解析...)的知识...

Mmm, funny, I had lot of exceptions in the Java console, yet it kind of worked (changing colors, but not doing much other work, apparently).

Exceptions were:

java.lang.NullPointerException
    at universe.draw(universe.java:262)
    at processing.core.PApplet.handleDisplay(PApplet.java:1359)
    at processing.core.PGraphics.requestDisplay(PGraphics.java:680)
    at processing.core.PApplet.run(PApplet.java:1454)
    at java.lang.Thread.run(Unknown Source)

which reveal at least how the applet was done: by using the excellent Processing environment (using a "simplified" Java and a good graphics library).

Since it didn't really worked for me, I can hardly tell you how it was done (what it was supposed to do?), but well, you have at least a starting point! Note that Processing offers good tutorials too...

[EDIT] I re-tried with a standard search term (New-York instead of JavaFX...), and I got some result. Quite impressive.
Obviously, lot of work have been put there.
I confirm you can learn a lot on the algorithms used there (graphical, network, data parsing...) by browsing (and interacting!) on the Processing site and forum...

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