When using GoogleWebToolkit (GWT) you can code you WebGL application in Java! GWT does compile your code to JavaScript, so end users will not notice a difference. You gain things like type-safety, class hierarchy, a nice widget system and code optimization though the compiler.
My module has the boring name ‘WebGL Toolkit’ (WGT), but provides WebGL support for GWT. This project is part of my Ultimate Conquest project (see below). WGT is licenced under GNU General Public License (Version 3).
Features
- [li] WebGL wrapper, including some related overlay types[/18h67gtc][/li][li] Canvas2D wrapper, including some related overlay types[/18h67gtc][/li][li] Mathlibrary, optimized for computer graphics purpose. Provided classes: BoundingSphere, Matrix22d, Matrix33d, Matrix44d, MatrixStack, Plane, Ray, Vector2d, Vector2i, Vector3d, Vector3i, Vector4d, Vector4i[/18h67gtc][/li][li] extendible ResourceManager with JSON-based file format. Provided resources: Library, Mesh, Texture2D, Shader, Simple3D, Sky, CompositeResource[/18h67gtc][/li][li] InputManager for mouse and keyboard input[/18h67gtc][/li][li] Simple (but extendible) log system.[/18h67gtc][/li][li] Simple (but extendible) SceneManager provides visibility detection and software picking.[/18h67gtc][/li][li] Point and Line renderer. However, points are not very useful yet since no browser supports points larger than 1 pixel.[/18h67gtc]
Requirements
- [li] GoogleWebToolkit 2.0.0 or later[/18h67gtc][/li][li] When ResourceManager class is used a HTTP-Server is required. It will not work on local filesystem since internally HTTP-requests are used to load resources.[/18h67gtc][/li][li] Obviously a WebGL capable browser is required.[/*18h67gtc]
Example
Together with WGT comes a small example which shows how to use all major classes. It’s a simple animated planet scene with Homeworld-style (*) camera system. You can disable the Glow-effect in the options menu.
>> Try Live demo! <<
(*) or Ultimate Conquest style…
- [li] To try it make the directory content of wgt-0.1/war available via HTTP. Access using local filesystem will not work. A local HTTP-Server (e.g. Apache) is very helpful during development.[/18h67gtc][/li][li] Controls:[/li][list:18h67gtc][li] LMB on Planet : center Camera on Planet[/18h67gtc][/li][li] RMB + MouseMove : rotate Camera. If you have problems with the popup menu, try STRG + MouseMove[/18h67gtc][/li][li] MouseWheel : zoom Camera[/18h67gtc][/li][li] W,S,A,D,Q,E : move Camera[/18h67gtc][/li][li] LMB + MouseMove on title: move toolwindow[/18h67gtc]
Download
>> wgt-0.1-091226.zip <<
Ultimate Conquest
Ultimate Conquest (UC) is a clone of the popular KDE game “Konquest” in development. WGT is a subproject which does collect all components that are general enough to be useful in other projects. UC is closed source, but WGT is available under GPLv3.
- [li] Demo version uc091214[/18h67gtc][/li][li] Youtube video[/18h67gtc][/li][] German project site with some screenshots, if you don’t speak German try google translation.[/18h67gtc]