Sunday, February 24, 2013

Conway's Game of Life using JavaFX 3D

I didn't need to change much of the code to run it in 3D - just replace rectangles with boxes, add camera and light - that's it.

What you'll get when using 3D features (in any language) is increased complexity. You have to think about the camera's position, it's field of view, the light sources, their position, the materials, reflections, textures ...

But: What is really impressive concerning JavaFX is that from the programmers viewpoint everything stays the same - for example, you can register your mouseOver actions on a Box in 3D the same way you can use it in 2D with Rectangles. The timelining works the same no matter if you animate 3D or 2D objects etc.

Here is the code for the video above (JDK8 needed!):

No comments:

Post a Comment