Long live Java
The following web app illustrates how easily Java and WebGL can be used together with Libgdx game development framework to create fancy 3D scenes.
Click on the image to see the webGL app. Note: you’ll need a WebGL compatible browser such as Firefox or Chrome.
Instructions: use the arrow keys to move the camera and drag the mouse to rotate the camera.
Notes about the code
- The code uses WebGL which is pretty much OpenGL ES 2.0.
- The sky and mountains background texture (a.k.a Skybox) are rendered using cube mapping and custom shaders.
- There is one shader program for rendering the water which is based on the excellent Jay Conrod’s water simulation shader. The water looks jaggy because there aren’t many triangles in the model. Feel free to change this.
- The boat 3D model comes from here and the texture from here.
- The teddy bear comes from here (if you know the original source, let me know).
- All models were exported to G3DT format using blender.
NB. The code will be available on github in the coming days.
Edit: The code is available here: https://github.com/recastrodiaz/java-webgl
Cross-platform game development
The holly grail of developers is to code once and run everywhere. Unfortunately, this is hardly true as platforms are extremely different from each other. Furthermore, screen sizes and input devices are not the same. Nevertheless, the Java ecosystem provides great multi platform support out of the box. Add GWT and Monotouch to the mix and you’ll support Mac, Windows, Linux, Android, HTML5 and iOS from day one. Check the following cross-platform gaming frameworks to see how it can be done: PlayN and Libgdx.