oneshotlm
Compare all models on this prompt →

Rotating icosahedron · gemma-4-31b-it

Using the pre-provided three.min.js (global THREE), render a full-screen scene with a rotating icosahedron lit by two colored point lights, orbit-style auto-rotation, and a subtle starfield background.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

Using the pre-provided three.min.js (global THREE), render a full-screen scene with a rotating icosahedron lit by two colored point lights, orbit-style auto-rotation, and a subtle starfield background.

assistant
thinking
The objective is to create a single-page web application (`index.html`) using `three.min.js` (already present in the current directory) that displays:
- A full-screen 3D scene.
- A rotating icosahedron.
- Two colored point lights.
- Orbit-style auto-rotation (the camera or the object moving in a circle).
- A subtle starfield background.
- All CSS and JS must be inline.
- No external resources (CDNs, network requests).

Plan:
1. Create `index.html`.
2. Include `<script src="three.min.js"></script>`.
3. Add CSS for a full-screen canvas without scrollbars.
4. In JavaScript:
    - Set up the Three.js scene, camera, and renderer.
    - Create an `IcosahedronGeometry` and a `MeshStandardMaterial` (so it reacts to light).
    - Add the icosahedron to the scene.
    - Create two `PointLight` instances with different colors (e.g., red and blue) and position them opposite each other.
    - Add an `AmbientLight` for general visibility.
    - Create a starfield using `BufferGeometry` and `Points`.
    - Implement a render loop that:
        - Rotates the icosahedron.
        - Updates the camera position to create an "orbit" effect.
        - Renders the scene.
    - Handle window resizing.

Let's start by writing the `index.html` file.
write index.html (3380 bytes)
toolResult

Successfully wrote 3380 bytes to index.html

assistant
thinking
The user requested a rotating icosahedron, two colored point lights, orbit-style auto-rotation, and a subtle starfield. I have implemented all these in a single `index.html` file, loading `three.min.js` locally.

- Rotating Icosahedron: Done (`icosahedron.rotation.x += 0.01; icosahedron.rotation.y += 0.01;`).
- Two colored point lights: Done (Red at `(2, 2, 2)` and Blue at `(-2, -2, 2)`).
- Orbit-style auto-rotation: Done (Camera moves in a circle using `sin` and `cos`).
- Subtle starfield background: Done (5000 points randomly distributed).
- Single file `index.html`: Done.
- No external resources: Done.
- `three.min.js` used: Done.

The code looks solid. I'll finish.

I have created a self-contained `index.html` file that renders the requested scene. It uses `three.min.js` to display a metallic icosahedron illuminated by red and blue point lights, with a camera that orbits the object and a randomly generated starfield in the background. ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Three.js Icosahedron Scene</title> <style> body { margin: 0; padding: 0; overflow: hidden; background-color: #000; } canvas { display: block; width: 100vw; height: 100vh; } </style> </head> <body> <script src="three.min.js"></script> <script> // Scene setup const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); const renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); document.body.appendChild(renderer.domElement); // Icosahedron const geometry = new THREE.IcosahedronGeometry(1, 0); const material = new THREE.MeshStandardMaterial({ color: 0xaaaaaa, flatShading: true, metalness: 0.7, roughness: 0.2 }); const icosahedron = new THREE.Mesh(geometry, material); scene.add(icosahedron); // Lights const light1 = new THREE.PointLight(0xff0000, 2, 10); // Red light light1.position.set(2, 2, 2); scene.add(light1); const light2 = new THREE.PointLight(0x0000ff, 2, 10); // Blue light light2.position.set(-2, -2, 2); scene.add(light2); const ambientLight = new THREE.AmbientLight(0x404040, 0.5); // Soft white light scene.add(ambientLight); // Starfield const starGeometry = new THREE.BufferGeometry(); const starMaterial = new THREE.PointsMaterial({ color: 0xffffff, size: 0.05 }); const starVertices = []; for (let i = 0; i < 5000; i++) { const x = (Math.random() - 0.5) * 100; const y = (Math.random() - 0.5) * 100; const z = (Math.random() - 0.5) * 100; starVertices.push(x, y, z); } starGeometry.setAttribute('position', new THREE.Float32BufferAttribute(starVertices, 3)); const stars = new THREE.Points(starGeometry, starMaterial); scene.add(stars); // Camera position initial camera.position.z = 3; // Animation state let time = 0; function animate() { requestAnimationFrame(animate); time += 0.01; // Rotate the icosahedron icosahedron.rotation.x += 0.01; icosahedron.rotation.y += 0.01; // Orbit the camera const radius = 4; camera.position.x = Math.sin(time * 0.5) * radius; camera.position.z = Math.cos(time * 0.5) * radius; camera.position.y = Math.sin(time * 0.3) * 2; camera.lookAt(0, 0, 0); renderer.render(scene, camera); } // Handle resize window.addEventListener('resize', () => { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize(window.innerWidth, window.innerHeight); }); animate(); </script> </body> </html> ```

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelgemma-4-31b-it
vendorGoogle
harnesspi-agent
generated2026-07-22

EVALUATION

3/5 working

Rotating icosahedron with red/blue point lights over a starfield rotates continuously but shows no real interactivity to inputs.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion0.8%
on click0.8%
on drag0.3%
on wheel0.3%
on enter + space0.3%
on arrow keys0.3%
on w/a/s/d1.1%
frame spread5.6 / 255
console errors0
js errors none

METRICS

runtime108.4s
tokens in4.4k
tokens out2.6k
cached0
cost / run$0.0015