Java 3D™ meets Scala

Java 3D Forum. Thread: Java 3D meets Scala.


Scala Forum. Topic: Scala 3D powered by Java 3D.


ScalaCanvas3D API : Seamless Integration of Java 3D Rendering into Scala Swing


The ScalaCanvas3D package provides Scala Swing components for heavyweight and lightweigth Java 3D rendering. Consequently, all Java 3D features and all additional 3rd party packages can be used in Scala 3D applications and applets.

  • SCanvas3D : heavyweight 3D rendering

  • SJCanvas3D : lightweight 3D rendering

  • SJCanvas3DAbstract : composite 2D and 3D rendering

Redistribution and use are permitted according to the standard Scala license. includes binaries, apidoc, sources, and license.  [download]

See also : Java 3D [Home] and Scala [Home]

ImScalaSwing API : Additional Scala Swing Components

This package includes Scala Swing components which are not yet available in the current release 2.9.1. They may be helpful until Scala Swing provides these components in a future release.

ImScalaSwing comprises following traits and classes:

  • LayeredPane
  • InternalDesktopPane
  • InternalDesktopManager, InternalDefaultDesktopManager
  • InternalFrame, InternalFrameEvent
  • PopupMenu

Redistribution and use are permitted according to the standard Scala license. includes binaries, apidoc, sources, and license. [download]

Sample Programs

The Scala applications (Java Web Start) require Java Plug-in JRE™ 5 and the Scala applets (JApplet) on this page JRE 6u10.

The Scala runtime 2.9.1 (scala-library.jar, scala-swing.jar) and Java 3D 1.5.2 will be downloaded into your local cache.

Mac™ user: please, check if the out-dated Java 3D version 1.3 is installed in System/Library/Java/Extensions/. It is advisable to remove all Java 3D related files (jar, jnilib).

All programs provide 3D mouse navigation. The left button rotates, the middle button zooms, and the right button drags the scene. The context menu (PopupMenu) allows to toggle between windowed and simulated fullscreen mode and to exit the application.


ScCharacterCube 1.3

Print your favorite 3D glyphs out of a set of 100 'Lucida Sans' characters.  [download]

Pick a character by a double click of the left mouse button to center its 3D shape. Zoom in or out to change the size. Render your view to an image and save it on your disk. The image size can be set up to 4096x4096 pixels or less depending on your graphics card.

(1) The application has a self-signed certificate that allows to save your shots and to set a Java 3D system variable for a transparent scene background. The maximum heap size is set to 768m.


ScDistortString 1.2

Composite 2D & 3D rendering anímated by the Java 3D engine.  [download]

The lightweight (offscreen) 3D rendering of the distorting characters and of the rebounding string within the 3D background image is reflected in a Graphics2D instance.

The transparent control panel can be moved out of the scene. Make the panel visible also by entering the graphics area with your mouse from the bottom.

The image-based gold texture is mapped onto the characters in two versions of conventional texture mapping.

The procedural wood texture is created and mapped by a vertex and fragment shader. The vertex shader also calculates the distorted vertex coordinates controlled by a Java 3D Behavior object. Running the wood texture requires OpenGL 2.0/GLSL 1.10 or higher.


ScPropeller 1.2

As of JRE 6u12 mixing heavyweight and lightweight components works almost perfectly.  [download]

Within a DesktopPane several InternalFrames 'host' a heavyweight Canvas3D and provide simultaneous views into the 3D scene. You can run the engine up to 600 RPM.

The 3D model based on the external 3D file format VRML™ (*.wrl) was replaced with a model of the successor format Extensible 3D (X3D™, *.x3d). The download includes the new X3D model and the corresponding importer API XModelImporter J3D. For more details see [here].