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).

  • WebGL wrapper, including some related overlay types[/*:m:18h67gtc]
  • Canvas2D wrapper, including some related overlay types[/*:m:18h67gtc]
  • Mathlibrary, optimized for computer graphics purpose. Provided classes: BoundingSphere, Matrix22d, Matrix33d, Matrix44d, MatrixStack, Plane, Ray, Vector2d, Vector2i, Vector3d, Vector3i, Vector4d, Vector4i[/*:m:18h67gtc]
  • extendible ResourceManager with JSON-based file format. Provided resources: Library, Mesh, Texture2D, Shader, Simple3D, Sky, CompositeResource[/*:m:18h67gtc]
  • InputManager for mouse and keyboard input[/*:m:18h67gtc]
  • Simple (but extendible) log system.[/*:m:18h67gtc]
  • Simple (but extendible) SceneManager provides visibility detection and software picking.[/*:m:18h67gtc]
  • Point and Line renderer. However, points are not very useful yet since no browser supports points larger than 1 pixel.[/*:m:18h67gtc]

  • GoogleWebToolkit 2.0.0 or later[/*:m:18h67gtc]
  • 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.[/*:m:18h67gtc]
  • Obviously a WebGL capable browser is required.[/*:m:18h67gtc]

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... :P

  • 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.[/*:m:18h67gtc]
  • Controls:
  • LMB on Planet : center Camera on Planet[/*:m:18h67gtc]
  • RMB + MouseMove : rotate Camera. If you have problems with the popup menu, try STRG + MouseMove[/*:m:18h67gtc]
  • MouseWheel : zoom Camera[/*:m:18h67gtc]
  • W,S,A,D,Q,E : move Camera[/*:m:18h67gtc]
  • LMB + MouseMove on title: move toolwindow[/*:m:18h67gtc]
[/*:m:18h67gtc][*] JSON library is located at wgt-0.1/war/r/library.json[/*:m:18h67gtc][*] Sourcecode is located at wgt-0.1/src/example/gwt[/*:m:18h67gtc][*] A look at the JavaDoc documentation at wgt-0.1/javadoc/index.html will also prove helpful.[/*:m:18h67gtc][/list:u:18h67gtc]

>> 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.