AI-Assisted 3D Web Development: From Requirements to Interactive Prototypes

    This article explores how AI can streamline 3D web development by generating renderable scene code from natural language prompts. Using a small ceramic studio's brand homepage as an example, it covers the four core elements of 3D web pages (models, materials, lighting, and camera/interaction), how to choose the right development tools, and a practical workflow from prompt engineering to iterative refinement. It also provides sample code for scroll-driven camera movement and outlines key quality assurance and maintenance considerations.

    1. Why 3D Web Pages Need AI Assistance

    Traditional 3D web development requires developers to master modeling, material design, lighting calculations, camera control, and page interaction logic simultaneously. For small teams and individual sites, the learning curve and labor costs across these stages are relatively high. With the code generation and tool invocation capabilities of large language models (LLMs), developers can now describe their visual goals in natural language, have the model output renderable scene code, and achieve a usable result through multiple rounds of refinement.

    This article uses the brand homepage of a small ceramic studio as an example to illustrate the complete workflow. It focuses on three key questions: What elements make up a 3D web page? How should you choose between different tool formats? And how should feedback be organized during the iteration process?

    2. Four Core Elements of 3D Web Pages

    2.1 Models

    Models represent the geometry within a scene. 3D models on a web page can be constructed directly from code—such as combining basic geometries like cubes, spheres, and cylinders to form the outline of a vessel—or by loading external model files. For ceramic-themed sites, a slowly rotating vessel outline usually serves as the most direct primary visual. When describing a model, provide size proportions, rotation axes, and subdivision levels, rather than simply stating “a vase.”

    2.2 Materials

    Materials determine how a surface reflects light. A glazed surface generally requires higher glossiness and lower roughness, while bisque-fired clay is more matte. When describing materials, you can use common parameters including color, metalness, roughness, transparency, and normal map strength. Crackled glaze textures (fine cracks on the glaze surface) can be generated using texture maps or procedural noise. The two approaches differ in visual effect and performance overhead, requiring a trade-off based on page requirements.

    2.3 Lighting

    Common light sources include ambient light, directional light, and point light. A single directional light can make shapes appear flat. Adding a warm side light and a cool fill light can highlight the layered texture of the glaze. The softness of shadows is jointly determined by the light source size and the number of shadow samples; the more samples, the smoother the edges, but the higher the computational cost.

    2.4 Camera and Interaction

    The camera determines what the audience sees. 3D content on a web page is typically bound to scrolling, mouse movements, or click events. For example, mapping page scroll progress to the camera’s angle on a circular orbit allows the vessel to gradually display different faces as the user scrolls. The key to interaction logic is converting input values (scroll position, pointer coordinates) into scene states (camera position, model rotation angle).

    3. Choosing Tool Formats Based on Operational Difficulty

    Different tool formats primarily differ in their barrier to entry and the controllability of the output.

    • Web-based generation: Has the lowest barrier to entry, suitable for quickly validating visual directions. The output is usually a single page or a few files, offering limited room for subsequent modifications.
    • Desktop smart coding tools: Allows progress through multi-turn conversations in a local project, can read and write files, and run previews. Suitable for projects requiring repeated adjustments.
    • Command line and editor plugins: Suitable for users familiar with terminals and development environments. Easy to integrate with version control and build processes, offering the highest degree of automation.

    When choosing, you should first clarify the task objective. If you only need a visual mockup, web-based tools are usually sufficient. If you need to deliver a long-term maintainable site, you should choose a tool that can manage a complete project structure. The general rule is: the more complex the operation, the stronger the control over the final output, and the higher the quality ceiling.

    4. Practical Workflow

    4.1 Expanding a One-Sentence Requirement into a Build Prompt

    Original requirements are often brief, such as “make a 3D brand homepage for a ceramic studio.” The model needs more constraints to produce stable results. A complete prompt generally includes the following sections:

    • Site goals: Showcase work, book experiences, or make inquiries
    • Visual style: Warm, ample whitespace, warm gray tones
    • Page structure: Above-the-fold 3D display area, portfolio list, studio introduction, contact information
    • Interaction rules: Scroll-driven camera, local highlighting on hover
    • Technical constraints: Single-file, no external dependencies, mobile-friendly

    Breaking down requirements into structured paragraphs is more effective than stacking adjectives. A clearly structured prompt reduces rework later on.

    4.2 Generating a Scrollable 3D Prototype

    Once the prompt is finalized, the tool will output the page skeleton, 3D scene code, and interaction scripts. The goal of the first generation is not perfection, but to confirm three things: the scene renders correctly, there is a corresponding relationship between scrolling and the camera, and there is no obvious misalignment across different screen widths.

    During acceptance testing, check item by item:

    1. Are there any loading errors when the page opens?
    2. Does the vessel angle change smoothly when scrolling through a full screen?
    3. Does the canvas scale correctly when adjusting the browser window width?
    4. Is the frame rate acceptable on lower-performance devices?

    4.3 Iterating Camera, Lighting, and Texture Details Using Reference Screen Recordings

    Once the prototype is running, you enter the detail tuning phase. Screen recording is a highly efficient feedback method. Recording a reference video or GIF of the desired effect and asking the model to point out differences based on the visual is more precise than text descriptions alone. For example, “the camera switches too early on the second screen” or “the glaze reflection is too harsh, increase the roughness”—these types of feedback can directly correspond to specific parameters.

    Change only one category of parameters per iteration to easily determine which modification caused the visual change. A reliable adjustment sequence is: first fix the camera path, then adjust the lighting, and finally handle the materials and crackled textures.

    5. Sample Code

    The following code illustrates the binding relationship between scrolling and the camera. Function names are for illustrative purposes and do not correspond to any specific API. sceneCamera refers to an already created camera object in the scene.

    1. // Illustration: Map scroll progress to the camera's angle on a circular orbit
    2. const ROTATION_RANGE = Math.PI * 2;
    3. const ORBIT_RADIUS = 4.5;
    4. function getScrollProgress() {
    5. const max = document.documentElement.scrollHeight - window.innerHeight;
    6. return max > 0 ? window.scrollY / max : 0;
    7. }
    8. function updateCamera(camera, progress) {
    9. const angle = progress * ROTATION_RANGE;
    10. camera.position.x = Math.sin(angle) * ORBIT_RADIUS;
    11. camera.position.z = Math.cos(angle) * ORBIT_RADIUS;
    12. camera.lookAt(0, 0, 0);
    13. }
    14. let ticking = false;
    15. window.addEventListener('scroll', () => {
    16. if (ticking) return;
    17. ticking = true;
    18. requestAnimationFrame(() => {
    19. updateCamera(sceneCamera, getScrollProgress());
    20. ticking = false;
    21. });
    22. });

    There are three key points to this code. First, the input value is normalized between 0 and 1 before being linearly mapped to the camera parameters. Second, constants are used to centrally manage the orbit radius and angle range, making subsequent adjustments easier. Third, the scroll event is processed uniformly within the animation frame, avoiding duplicate calculations and redraws within the same frame.

    6. Quality Assurance and Common Issues

    • Performance: The main overhead of 3D scenes comes from the number of geometries, shadow calculations, and texture sizes. Display textures generally do not need to be overly large, and resolutions can be further reduced for mobile devices.
    • Accessibility: 3D content should not carry critical information. Text such as contact details and work descriptions should be kept as standard HTML elements for screen readers and search engines to read.
    • Degradation strategy: When a device does not support 3D rendering, the page should fall back to static images to ensure core information remains accessible.
    • Maintainability: Parameters like colors, radius, and speed should be centrally defined in a configuration section, avoiding being scattered throughout the code.

    7. Implementation Advice

    If the goal is to quickly validate a visual direction, you can start by generating a prototype using a lower-barrier tool. If the page requires long-term maintenance, it should be delivered in a project-based tool, and both the prompts and reference screen recordings should be saved for reuse in subsequent iterations.