Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek-v4-flash-webdev· DeepSeekHugging Face Arena WebDev Preferences (2026)

Make simple voxel redactor in html

  1. User

    Make simple voxel redactor in html

  2. DeepSeek Assistant

    I'll create a simple voxel editor (3D block editor) using React, Three.js, and Tailwind CSS. Let me start by exploring the project structure and setting things up.

    Let me install Three.js and @react-three/fiber for the 3D rendering:

    Now let me update the index.html title and create all the necessary files:

    Now let me create the voxel editor application. I'll make several files:

    1. The main App component with the 3D editor
    2. A VoxelScene component for Three.js rendering
    3. UI components for the toolbar

    Let me create the main App.tsx:

    Now create the VoxelScene component:

    Let me fix the VoxelScene - there were some issues with the import order and unused variables:

    I need to rewrite this file properly - the import of useState is in the wrong place, and there's an issue with the CursorGhost approach. Let me rewrite it with a simpler and more robust cursor ghost that uses raycasting against the ground plane from the pointer:

    Now let's build to check for errors:

    The build succeeded. Now let me update the cursor ghost to also support clicking on the ground plane to place voxels, and make the tool actually clickable. Let me also improve the app to handle ground clicks:

    Build succeeds. Now let me also improve the App.tsx to support placing voxels on top of existing ones (not just on the ground). Let me add this feature:

    Let me remove the unused voxelAt:

    The project builds successfully. Let me also clean up the unused PLACEHOLDER constant properly. Let me now also check the unused import in App.tsx:

    Good, sceneRef and VoxelSceneHandle are used. The build is clean. Let me do one final build to confirm everything is perfect:

    The voxel editor is built and ready! Here's what I created:

    🧊 Simple Voxel Editor

    A 3D voxel (block) editor built with React, Three.js (via @react-three/fiber), and Tailwind CSS.

    Features:

    • 3 Tools: Place (✏️), Remove (🗑️), and Paint (🎨) voxels
    • 12-color palette: Choose from a variety of colors to build your creations
    • Orbit controls: Drag to rotate the view, scroll to zoom in/out
    • Snap-to-grid: Voxels snap to a 1-unit grid on a flat ground plane
    • Ghost preview: See where the next voxel will be placed with a transparent preview
    • Grid toggle: Show/hide the ground grid
    • Export/Import: Save your creations as JSON files and load them back
    • Clear All: Reset the scene

    Controls:

    ActionInput
    Place/Paint/Remove voxelLeft click on ground or existing voxel
    Rotate viewDrag with mouse
    ZoomScroll wheel

    Files created:

    • src/App.tsx — Main UI with the toolbar and state management
    • src/VoxelScene.tsx — Three.js 3D scene with voxels, ground, grid, and ghost cursor

    Files built: index.html, src/App.tsx, src/VoxelScene.tsx

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.