Java scene graph · TeaVM · WebGL

3D in the browser.
Written in Java.

A small Three.js-inspired library with no JavaScript runtime dependency. TeaVM compiles the scene, glTF loader, LMCode host API, transforms, animation, controls, and WebGL calls.

This demo requires a browser with WebGL support.

LIVE WEBGL

Drag to orbit · Scroll to zoom

Scene controls

Built with objects.

Compiling the scene…

Waiting for the first frame

Scene
3 meshes
Lighting
Ambient + directional + point
Camera
Perspective + orbit controls
Renderer
Indexed WebGL 1

01

A familiar scene graph

Compose Object3D, Group, Scene, and Mesh nodes with position, rotation, scale, visibility, and inherited world transforms.

02

Real GPU rendering

Indexed geometry, cached buffers, inverse-transpose normals, Phong and unlit materials, depth testing, and three light types.

03

Java browser events

OrbitControls listens for pointer and wheel events. requestAnimationFrame updates the same Java scene every frame.

One language, end to end

Create. Position. Render.

The API is intentionally recognizable to Three.js users, while remaining ordinary Java. lm3d is a focused subset, not a drop-in Three.js port.

Read the LLM quick reference →
Scene scene = new Scene();
PerspectiveCamera camera =
    new PerspectiveCamera(48, 16f / 9, 0.1f, 100);
camera.position.set(5, 4, 7);
camera.lookAt(0, 1, 0);

Mesh cube = new Mesh(
    new BoxGeometry(2, 2, 2),
    new MeshPhongMaterial("#61d6c5"));
cube.position.y = 1.25f;
scene.add(cube);
scene.add(new AmbientLight("#ffffff", 0.4f));

WebGLRenderer renderer = new WebGLRenderer(canvas);
renderer.setSize(960, 540);
renderer.render(scene, camera);