Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-2025-04-14· OpenAIHugging Face LMArena Human Preference 140K

하나의 HTML 파일로 3D 메카 고질라 만들어

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Amazon Novaamazon.nova-pro-v1:0’s answer.
  1. User

    하나의 HTML 파일로 3D 메카 고질라 만들어

  2. Assistant

    하나의 HTML 파일로 3D 메카 고질라를 만드는 것은 꽤 도전적인 작업입니다!
    하지만 Three.js와 같은 3D 라이브러리를 사용하면, 간단한 형태의 메카 고질라를 구현할 수 있습니다.
    아래는 Three.js를 이용해 기본적인 3D 메카 고질라(로봇 공룡 형태)를 만드는 예시입니다.

    설명:

    • Three.js CDN을 사용합니다.
    • 여러 개의 박스(큐브), 원통, 구 등 기본 도형을 조합해 메카 고질라의 몸통, 머리, 팔, 다리, 꼬리를 만듭니다.
    • 아주 간단한 형태이지만, 3D로 회전/확대/축소가 가능합니다.

    <!DOCTYPE html>
    <html lang="ko">
    <head>
      <meta charset="UTF-8">
      <title>3D 메카 고질라 (Three.js)</title>
      <style>
        body { margin: 0; background: #222; }
        canvas { display: block; }
        #info {
          position: absolute; top: 10px; left: 10px; color: #fff; font-family: sans-serif;
          background: rgba(0,0,0,0.5); padding: 10px; border-radius: 8px;
        }
      </style>
    </head>
    <body>
      <div id="info">마우스로 드래그해서 회전하세요!<br>3D 메카 고질라 (간단 버전)</div>
      <script src="https://cdn.jsdelivr.net/npm/three@0.153.0/build/three.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/three@0.153.0/examples/js/controls/OrbitControls.js"></script>
      <script>
        // 기본 세팅
        const scene = new THREE.Scene();
        scene.background = new THREE.Color(0x222222);
    
        const camera = new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, 0.1, 1000);
        camera.position.set(0, 5, 18);
    
        const renderer = new THREE.WebGLRenderer({antialias:true});
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.body.appendChild(renderer.domElement);
    
        // 조명
        const light = new THREE.DirectionalLight(0xffffff, 1.2);
        light.position.set(10, 20, 10);
        scene.add(light);
        scene.add(new THREE.AmbientLight(0x888888, 0.7));
    
        // 재질
        const metal = new THREE.MeshStandardMaterial({color:0x8888aa, metalness:0.7, roughness:0.3});
        const red = new THREE.MeshStandardMaterial({color:0xff3333, metalness:0.8, roughness:0.2});
        const yellow = new THREE.MeshStandardMaterial({color:0xffff00, metalness:0.8, roughness:0.2});
        const eye = new THREE.MeshStandardMaterial({color:0xff0000, emissive:0xff0000, emissiveIntensity:0.7});
    
        // 몸통
        const body = new THREE.Mesh(new THREE.CylinderGeometry(1.7, 2.2, 5, 16), metal);
        body.position.y = 3;
        scene.add(body);
    
        // 머리
        const head = new THREE.Mesh(new THREE.SphereGeometry(1.2, 16, 16), metal);
        head.position.set(0, 6.2, 0.5);
        scene.add(head);
    
        // 눈
        const leftEye = new THREE.Mesh(new THREE.SphereGeometry(0.18, 8, 8), eye);
        leftEye.position.set(-0.45, 6.4, 1.3);
        scene.add(leftEye);
        const rightEye = leftEye.clone();
        rightEye.position.x = 0.45;
        scene.add(rightEye);
    
        // 입(턱)
        const jaw = new THREE.Mesh(new THREE.CylinderGeometry(0.7, 0.9, 0.5, 12), metal);
        jaw.position.set(0, 5.5, 0.7);
        jaw.rotation.x = Math.PI/2.5;
        scene.add(jaw);
    
        // 등(스파이크)
        for(let i=0; i<5; i++) {
          const spike = new THREE.Mesh(new THREE.ConeGeometry(0.3, 1.2, 8), yellow);
          spike.position.set(0, 2.5 + i*0.7, -1.2 - i*0.3);
          spike.rotation.x = -Math.PI/6;
          scene.add(spike);
        }
    
        // 팔
        function makeArm(side=1) {
          const arm = new THREE.Group();
          const upper = new THREE.Mesh(new THREE.CylinderGeometry(0.3, 0.4, 2, 8), metal);
          upper.position.y = -1;
          upper.rotation.z = side * Math.PI/8;
          arm.add(upper);
    
          const lower = new THREE.Mesh(new THREE.CylinderGeometry(0.25, 0.3, 1.5, 8), metal);
          lower.position.y = -2.2;
          lower.rotation.z = side * Math.PI/10;
          arm.add(lower);
    
          const hand = new THREE.Mesh(new THREE.SphereGeometry(0.35, 8, 8), red);
          hand.position.y = -3;
          arm.add(hand);
    
          arm.position.set(side*2.2, 4.5, 0);
          scene.add(arm);
        }
        makeArm(1); // 오른팔
        makeArm(-1); // 왼팔
    
        // 다리
        function makeLeg(side=1) {
          const leg = new THREE.Group();
          const upper = new THREE.Mesh(new THREE.CylinderGeometry(0.5, 0.6, 2, 10), metal);
          upper.position.y = -1;
          leg.add(upper);
    
          const lower = new THREE.Mesh(new THREE.CylinderGeometry(0.4, 0.5, 1.5, 10), metal);
          lower.position.y = -2.2;
          leg.add(lower);
    
          const foot = new THREE.Mesh(new THREE.BoxGeometry(0.7, 0.3, 1.2), red);
          foot.position.y = -3;
          foot.position.z = 0.3;
          leg.add(foot);
    
          leg.position.set(side*1, 0.5, 0.2);
          scene.add(leg);
        }
        makeLeg(1); // 오른다리
        makeLeg(-1); // 왼다리
    
        // 꼬리
        for(let i=0; i<6; i++) {
          const tail = new THREE.Mesh(
            new THREE.CylinderGeometry(0.5-0.07*i, 0.4-0.06*i, 1.1, 8),
            metal
          );
          tail.position.set(0, 1.2-i*0.5, -2.2-i*0.7);
          tail.rotation.x = -Math.PI/7;
          scene.add(tail);
        }
    
        // OrbitControls
        const controls = new THREE.OrbitControls(camera, renderer.domElement);
    
        // 반응형
        window.addEventListener('resize', ()=>{
          camera.aspect = window.innerWidth/window.innerHeight;
          camera.updateProjectionMatrix();
          renderer.setSize(window.innerWidth, window.innerHeight);
        });
    
        // 애니메이션 루프
        function animate() {
          requestAnimationFrame(animate);
          renderer.render(scene, camera);
        }
        animate();
      </script>
    </body>
    </html>
    

    💡 팁

    • 이 코드는 기본 도형만으로 만든 단순한 메카 고질라입니다.
    • 더 디테일한 모델을 원한다면 Blender 등에서 3D 모델링 후 Three.js로 불러와야 합니다.
    • 마우스로 드래그하면 3D로 회전시켜 볼 수 있습니다.

    궁금한 점이나 추가 요청이 있으면 말씀해 주세요!

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