The official team verified Qwen3.7-Max's capability to implement complete Three.js 3D electronic Rubik's Cube rendering, mouse drag layer-rotation animations, and state machine solving within a single HTML architecture via end-to-end prompts.
Suitable tasks: Single-page Web 3D interactive prototype development, Three.js / WebGL physical rendering, geometric transformations, and discrete state-machine programming.
Unsuitable tasks: Heavyweight MMORPG games relying on complex backend state synchronization, or engineering software requiring high-precision CAD industrial model imports.
Applicable model versions: qwen3.7-max.
Applicable clients, Agents, or APIs: Qwen Studio, Alibaba Cloud Model Studio, Claude Code, Cursor.
Recommended reasoning level and parameters: Enable Thinking mode (high level) to ensure 3D spatial matrix transformations and raycasting logic are deduced correctly in a single pass.
Please implement a fully functional 3D electronic Rubik's Cube (Rubik's Cube) web prototype using HTML5 + Three.js + OrbitControls.
The following technical and interaction requirements must be met:
1. Geometry construction and rendering:
- Build a standard 3x3x3 Rubik's Cube composed of 27 independent cubelets (Cubelet) ;
- Each cubelet features standard 6-color faces (white, yellow, red, orange, blue, green) , with inner non-visible faces rendered using a dark gray material;
- Use ambient light paired with directional light, with materials featuring appropriate specular highlights and shadow textures.
2. Interaction and rotation physics mechanism:
- Viewport control: Support right-click or background dragging to freely rotate the global perspective;
- Raycasting (Raycasting) : Support left-click to pick the contact point and drag direction on the cube's faces;
- Layer rotation: Automatically determine the Rubik's Cube slice to rotate (Slice: the 9 cubelets corresponding to the X/Y/Z axes) based on the picked surface normal and drag vector;
- Smooth animation: Rotations must render a 90-degree rotation animation via an easing function (such as requestAnimationFrame + TWEEN or smooth interpolation) , prohibiting conflicting inputs during the animation;
- State reset after rotation: After each layer rotation completes, correctly update the actual global spatial positions and rotation matrices of all 27 cubelets (maintaining decoupled parent-child node hierarchy) .
3. Auxiliary features and UI:
- Provide a clean floating control panel containing: "Scramble (Scramble) " and "Reset (Reset) " buttons;
- The scramble feature must execute 20 random legal rotations accompanied by a rapid, coherent animation demonstration.
4. Delivery constraints:
- Consolidate all code into a single, complete HTML file (importing dependencies like Three.js via CDN) , running directly upon double-clicking in a browser without relying on any local build pipeline.Feed the above prompt into the Qwen3.7-Max endpoint, enabling chain-of-thought reasoning to derive 3D spatial quaternions and hierarchy-decoupling matrices.
Receive the generated complete HTML code and save it as rubiks_cube_demo.html.
Open the file in a real Chrome browser and perform multi-dimensional interaction acceptance:
Check the 6-color face configuration and lighting textures;
Test picking any face with the mouse and dragging to verify whether slice rotation animations are smooth without mesh tearing;
Execute continuous scrambling and step-by-step restoration to verify whether matrix resets remain stable after rotations;
Check the console (Console) for NaN matrices or WebGL rendering errors.
Tongyi Lab and Alibaba Cloud officially published a real machine demonstration video on social media showcasing the electronic Rubik's Cube generated in a single pass by Qwen3.7-Max based on this prompt.
The video demonstrates the model's closed-loop code generation capabilities when handling discrete geometric tasks such as complex 3D spatial coordinate transformations (Local Coordinate to World Coordinate) , raycasting normal determination, and easing animation control.
Single-pass generation relies on CDN script availability; in network-restricted environments, scripts should be replaced with local static assets.
Spatial quaternions and multi-axis compound rotations consume substantial reasoning tokens. If Thinking mode is disabled, issues such as pivot drift after slice rotations or cube mesh clipping artifacts are likely to occur.
Official release note summary: "Built with Qwen3.7-Max: Check out this demo and step-by-step tutorial for an Electronic Rubik's Cube... Experience our agentic capabilities".
Qwen3.7 Max