/jsweet-examples-threejs

Some examples to demonstrate using the threejs framework from JSweet.

Primary LanguageJavaScript

JSweet Examples (threejs framework)

Some examples to demonstrate using the awesome http://threejs.org framework (WebGL powered 3D) from Java thanks to the JSweet tranpiler.

  • [webgl_interactive_cubes.html] An example showing cubes, which you can highlight by clicking. [browse]
  • [webgl_materials_normalmap.html] An example showing Lee Perry-Smith (Infinite-Realities). [browse]

These examples are direct translations to JSweet of some of the JavaScript examples taken from the threejs web site. Of course, copyrights fully remain to the original authors.

Check out more JSweet examples.

Usage

> git clone https://github.com/cincheo/jsweet-examples-threejs.git
> cd jsweet-examples-threejs
> mvn generate-sources
> firefox webapp/${example}.html

Prerequisites

The node and npm executables must be in the path (https://nodejs.org). Install Maven (https://maven.apache.org/install.html).

Note on strict mode

These examples compile with JSweet in strict mode: jsweet-core-strict must be placed first (before the JDK) in the classpath. In strict mode, JavaScript APIs replace Java APIs even on java.lang objects. In strict mode, it is not possible to compile regular Java code (using regular Java APIs) at all.