Codels
삼각형 1.1천개3.13 × 2.08 × 1.61 m

코드에서 사용하기

에디터에서 리믹스
독립형 ES 모듈이에요 — three에만 의존해요. 팩토리 함수를 호출하고 그룹을 씬에 추가하세요.
/**
 * Goal Post — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 1,140 · Size (W × H × D): 3.13 × 2.08 × 1.61 m
 *
 * Usage:
 *   import { createGoalPost } from './goal-post.js';
 *   
 *   const model = createGoalPost();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

export function createGoalPost() {
  const root = new THREE.Group();
  root.name = 'GoalPost';

  // Materials
  const frameMat = new THREE.MeshStandardMaterial({ name: 'frame', color: 0xf2f3f5, roughness: 0.4, metalness: 0.2, flatShading: true });
  const accentMat = new THREE.MeshStandardMaterial({ name: 'accent', color: 0xe8392f, roughness: 0.45, metalness: 0.15, flatShading: true });
  const netMat = new THREE.MeshStandardMaterial({ name: 'net', color: 0xe9edf2, roughness: 0.8, flatShading: true });
  const lineMat = new THREE.MeshStandardMaterial({ name: 'line', color: 0xd8fff6, roughness: 0.4, emissive: 0x59ffd9, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.06, 0.06, 2, 8);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.064, 0.064, 0.16, 8);
  const cylinderGeo3 = new THREE.CylinderGeometry(0.042, 0.042, 0.7, 6);
  const cylinderGeo4 = new THREE.CylinderGeometry(0.042, 0.042, 2.1541, 6);
  const cylinderGeo5 = new THREE.CylinderGeometry(0.042, 0.042, 1.5, 6);
  const cylinderGeo6 = new THREE.CylinderGeometry(0.042, 0.042, 3, 6);
  const boxGeo = new THREE.BoxGeometry(0.014, 0.014, 0.7);
  const boxGeo2 = new THREE.BoxGeometry(0.014, 2.1541, 0.014);
  const boxGeo3 = new THREE.BoxGeometry(3, 0.014, 0.014);
  const boxGeo4 = new THREE.BoxGeometry(0.014, 2, 0.014);
  const boxGeo5 = new THREE.BoxGeometry(0.014, 1.875, 0.014);
  const boxGeo6 = new THREE.BoxGeometry(0.014, 1.25, 0.014);
  const boxGeo7 = new THREE.BoxGeometry(0.014, 0.625, 0.014);
  const boxGeo8 = new THREE.BoxGeometry(0.014, 0.014, 1.4);
  const boxGeo9 = new THREE.BoxGeometry(0.014, 0.014, 1.3);
  const boxGeo10 = new THREE.BoxGeometry(0.014, 0.014, 1.2);
  const boxGeo11 = new THREE.BoxGeometry(0.014, 0.014, 1.1);
  const boxGeo12 = new THREE.BoxGeometry(0.014, 0.014, 1);
  const boxGeo13 = new THREE.BoxGeometry(0.014, 0.014, 0.9);
  const boxGeo14 = new THREE.BoxGeometry(0.014, 0.014, 0.8);

  // Parts
  const soccerGoal = new THREE.Group();
  soccerGoal.name = 'soccerGoal';
  root.add(soccerGoal);
  const postLeft = new THREE.Mesh(cylinderGeo, frameMat);
  postLeft.name = 'postLeft';
  postLeft.position.set(-1.5, 1, 0.75);
  soccerGoal.add(postLeft);
  const cylinder3 = new THREE.Mesh(cylinderGeo2, accentMat);
  cylinder3.position.set(-1.5, 0.44, 0.75);
  soccerGoal.add(cylinder3);
  const cylinder4 = new THREE.Mesh(cylinderGeo2, accentMat);
  cylinder4.position.set(-1.5, 1, 0.75);
  soccerGoal.add(cylinder4);
  const cylinder5 = new THREE.Mesh(cylinderGeo2, accentMat);
  cylinder5.position.set(-1.5, 1.56, 0.75);
  soccerGoal.add(cylinder5);
  const cylinder6 = new THREE.Mesh(cylinderGeo3, frameMat);
  cylinder6.position.set(-1.5, 2, 0.4);
  cylinder6.rotation.set(deg(-90), 0, 0);
  soccerGoal.add(cylinder6);
  const backStayLeft = new THREE.Mesh(cylinderGeo4, frameMat);
  backStayLeft.name = 'backStayLeft';
  backStayLeft.position.set(-1.5, 1, -0.35);
  backStayLeft.rotation.set(deg(-158.1986), 0, 0);
  soccerGoal.add(backStayLeft);
  const cylinder8 = new THREE.Mesh(cylinderGeo5, frameMat);
  cylinder8.position.set(-1.5, 0.042, 0);
  cylinder8.rotation.set(deg(-90), 0, 0);
  soccerGoal.add(cylinder8);
  const postRight = new THREE.Mesh(cylinderGeo, frameMat);
  postRight.name = 'postRight';
  postRight.position.set(1.5, 1, 0.75);
  soccerGoal.add(postRight);
  const cylinder10 = new THREE.Mesh(cylinderGeo2, accentMat);
  cylinder10.position.set(1.5, 0.44, 0.75);
  soccerGoal.add(cylinder10);
  const cylinder11 = new THREE.Mesh(cylinderGeo2, accentMat);
  cylinder11.position.set(1.5, 1, 0.75);
  soccerGoal.add(cylinder11);
  const cylinder12 = new THREE.Mesh(cylinderGeo2, accentMat);
  cylinder12.position.set(1.5, 1.56, 0.75);
  soccerGoal.add(cylinder12);
  const cylinder13 = new THREE.Mesh(cylinderGeo3, frameMat);
  cylinder13.position.set(1.5, 2, 0.4);
  cylinder13.rotation.set(deg(-90), 0, 0);
  soccerGoal.add(cylinder13);
  const backStayRight = new THREE.Mesh(cylinderGeo4, frameMat);
  backStayRight.name = 'backStayRight';
  backStayRight.position.set(1.5, 1, -0.35);
  backStayRight.rotation.set(deg(-158.1986), 0, 0);
  soccerGoal.add(backStayRight);
  const cylinder15 = new THREE.Mesh(cylinderGeo5, frameMat);
  cylinder15.position.set(1.5, 0.042, 0);
  cylinder15.rotation.set(deg(-90), 0, 0);
  soccerGoal.add(cylinder15);
  const crossbar = new THREE.Mesh(new THREE.CylinderGeometry(0.06, 0.06, 3.12, 8), frameMat);
  crossbar.name = 'crossbar';
  crossbar.position.set(0, 2, 0.75);
  crossbar.rotation.set(0, 0, deg(90));
  soccerGoal.add(crossbar);
  const topBackBar = new THREE.Mesh(cylinderGeo6, frameMat);
  topBackBar.name = 'topBackBar';
  topBackBar.position.set(0, 2, 0.05);
  topBackBar.rotation.set(0, 0, deg(90));
  soccerGoal.add(topBackBar);
  const groundBar = new THREE.Mesh(cylinderGeo6, frameMat);
  groundBar.name = 'groundBar';
  groundBar.position.set(0, 0.042, -0.75);
  groundBar.rotation.set(0, 0, deg(90));
  soccerGoal.add(groundBar);
  const goalLine = new THREE.Mesh(new THREE.BoxGeometry(2.88, 0.012, 0.08), lineMat);
  goalLine.name = 'goalLine';
  goalLine.position.set(0, 0.006, 0.75);
  soccerGoal.add(goalLine);
  const net = new THREE.Group();
  net.name = 'net';
  soccerGoal.add(net);
  const box21 = new THREE.Mesh(boxGeo, netMat);
  box21.position.set(-1.25, 2, 0.4);
  net.add(box21);
  const box22 = new THREE.Mesh(boxGeo, netMat);
  box22.position.set(-1, 2, 0.4);
  net.add(box22);
  const box23 = new THREE.Mesh(boxGeo, netMat);
  box23.position.set(-0.75, 2, 0.4);
  net.add(box23);
  const box24 = new THREE.Mesh(boxGeo, netMat);
  box24.position.set(-0.5, 2, 0.4);
  net.add(box24);
  const box25 = new THREE.Mesh(boxGeo, netMat);
  box25.position.set(-0.25, 2, 0.4);
  net.add(box25);
  const box26 = new THREE.Mesh(boxGeo, netMat);
  box26.position.set(0, 2, 0.4);
  net.add(box26);
  const box27 = new THREE.Mesh(boxGeo, netMat);
  box27.position.set(0.25, 2, 0.4);
  net.add(box27);
  const box28 = new THREE.Mesh(boxGeo, netMat);
  box28.position.set(0.5, 2, 0.4);
  net.add(box28);
  const box29 = new THREE.Mesh(boxGeo, netMat);
  box29.position.set(0.75, 2, 0.4);
  net.add(box29);
  const box30 = new THREE.Mesh(boxGeo, netMat);
  box30.position.set(1, 2, 0.4);
  net.add(box30);
  const box31 = new THREE.Mesh(boxGeo, netMat);
  box31.position.set(1.25, 2, 0.4);
  net.add(box31);
  const box32 = new THREE.Mesh(boxGeo2, netMat);
  box32.position.set(-1.25, 1, -0.35);
  box32.rotation.set(deg(-158.1986), 0, 0);
  net.add(box32);
  const box33 = new THREE.Mesh(boxGeo2, netMat);
  box33.position.set(-1, 1, -0.35);
  box33.rotation.set(deg(-158.1986), 0, 0);
  net.add(box33);
  const box34 = new THREE.Mesh(boxGeo2, netMat);
  box34.position.set(-0.75, 1, -0.35);
  box34.rotation.set(deg(-158.1986), 0, 0);
  net.add(box34);
  const box35 = new THREE.Mesh(boxGeo2, netMat);
  box35.position.set(-0.5, 1, -0.35);
  box35.rotation.set(deg(-158.1986), 0, 0);
  net.add(box35);
  const box36 = new THREE.Mesh(boxGeo2, netMat);
  box36.position.set(-0.25, 1, -0.35);
  box36.rotation.set(deg(-158.1986), 0, 0);
  net.add(box36);
  const box37 = new THREE.Mesh(boxGeo2, netMat);
  box37.position.set(0, 1, -0.35);
  box37.rotation.set(deg(-158.1986), 0, 0);
  net.add(box37);
  const box38 = new THREE.Mesh(boxGeo2, netMat);
  box38.position.set(0.25, 1, -0.35);
  box38.rotation.set(deg(-158.1986), 0, 0);
  net.add(box38);
  const box39 = new THREE.Mesh(boxGeo2, netMat);
  box39.position.set(0.5, 1, -0.35);
  box39.rotation.set(deg(-158.1986), 0, 0);
  net.add(box39);
  const box40 = new THREE.Mesh(boxGeo2, netMat);
  box40.position.set(0.75, 1, -0.35);
  box40.rotation.set(deg(-158.1986), 0, 0);
  net.add(box40);
  const box41 = new THREE.Mesh(boxGeo2, netMat);
  box41.position.set(1, 1, -0.35);
  box41.rotation.set(deg(-158.1986), 0, 0);
  net.add(box41);
  const box42 = new THREE.Mesh(boxGeo2, netMat);
  box42.position.set(1.25, 1, -0.35);
  box42.rotation.set(deg(-158.1986), 0, 0);
  net.add(box42);
  const box43 = new THREE.Mesh(boxGeo3, netMat);
  box43.position.set(0, 1.7778, -0.0389);
  net.add(box43);
  const box44 = new THREE.Mesh(boxGeo3, netMat);
  box44.position.set(0, 1.5556, -0.1278);
  net.add(box44);
  const box45 = new THREE.Mesh(boxGeo3, netMat);
  box45.position.set(0, 1.3333, -0.2167);
  net.add(box45);
  const box46 = new THREE.Mesh(boxGeo3, netMat);
  box46.position.set(0, 1.1111, -0.3056);
  net.add(box46);
  const box47 = new THREE.Mesh(boxGeo3, netMat);
  box47.position.set(0, 0.8889, -0.3944);
  net.add(box47);
  const box48 = new THREE.Mesh(boxGeo3, netMat);
  box48.position.set(0, 0.6667, -0.4833);
  net.add(box48);
  const box49 = new THREE.Mesh(boxGeo3, netMat);
  box49.position.set(0, 0.4444, -0.5722);
  net.add(box49);
  const box50 = new THREE.Mesh(boxGeo3, netMat);
  box50.position.set(0, 0.2222, -0.6611);
  net.add(box50);
  const box51 = new THREE.Mesh(boxGeo4, netMat);
  box51.position.set(-1.5, 1, 0.5);
  net.add(box51);
  const box52 = new THREE.Mesh(boxGeo4, netMat);
  box52.position.set(-1.5, 1, 0.25);
  net.add(box52);
  const box53 = new THREE.Mesh(boxGeo5, netMat);
  box53.position.set(-1.5, 0.9375, 0);
  net.add(box53);
  const box54 = new THREE.Mesh(boxGeo6, netMat);
  box54.position.set(-1.5, 0.625, -0.25);
  net.add(box54);
  const box55 = new THREE.Mesh(boxGeo7, netMat);
  box55.position.set(-1.5, 0.3125, -0.5);
  net.add(box55);
  const box56 = new THREE.Mesh(boxGeo8, netMat);
  box56.position.set(-1.5, 0.25, 0.05);
  net.add(box56);
  const box57 = new THREE.Mesh(boxGeo9, netMat);
  box57.position.set(-1.5, 0.5, 0.1);
  net.add(box57);
  const box58 = new THREE.Mesh(boxGeo10, netMat);
  box58.position.set(-1.5, 0.75, 0.15);
  net.add(box58);
  const box59 = new THREE.Mesh(boxGeo11, netMat);
  box59.position.set(-1.5, 1, 0.2);
  net.add(box59);
  const box60 = new THREE.Mesh(boxGeo12, netMat);
  box60.position.set(-1.5, 1.25, 0.25);
  net.add(box60);
  const box61 = new THREE.Mesh(boxGeo13, netMat);
  box61.position.set(-1.5, 1.5, 0.3);
  net.add(box61);
  const box62 = new THREE.Mesh(boxGeo14, netMat);
  box62.position.set(-1.5, 1.75, 0.35);
  net.add(box62);
  const box63 = new THREE.Mesh(boxGeo4, netMat);
  box63.position.set(1.5, 1, 0.5);
  net.add(box63);
  const box64 = new THREE.Mesh(boxGeo4, netMat);
  box64.position.set(1.5, 1, 0.25);
  net.add(box64);
  const box65 = new THREE.Mesh(boxGeo5, netMat);
  box65.position.set(1.5, 0.9375, 0);
  net.add(box65);
  const box66 = new THREE.Mesh(boxGeo6, netMat);
  box66.position.set(1.5, 0.625, -0.25);
  net.add(box66);
  const box67 = new THREE.Mesh(boxGeo7, netMat);
  box67.position.set(1.5, 0.3125, -0.5);
  net.add(box67);
  const box68 = new THREE.Mesh(boxGeo8, netMat);
  box68.position.set(1.5, 0.25, 0.05);
  net.add(box68);
  const box69 = new THREE.Mesh(boxGeo9, netMat);
  box69.position.set(1.5, 0.5, 0.1);
  net.add(box69);
  const box70 = new THREE.Mesh(boxGeo10, netMat);
  box70.position.set(1.5, 0.75, 0.15);
  net.add(box70);
  const box71 = new THREE.Mesh(boxGeo11, netMat);
  box71.position.set(1.5, 1, 0.2);
  net.add(box71);
  const box72 = new THREE.Mesh(boxGeo12, netMat);
  box72.position.set(1.5, 1.25, 0.25);
  net.add(box72);
  const box73 = new THREE.Mesh(boxGeo13, netMat);
  box73.position.set(1.5, 1.5, 0.3);
  net.add(box73);
  const box74 = new THREE.Mesh(boxGeo14, netMat);
  box74.position.set(1.5, 1.75, 0.35);
  net.add(box74);

  root.traverse((o) => {
    if (o.isMesh) {
      o.castShadow = true;
      o.receiveShadow = true;
    }
  });
  return root;
}

export default createGoalPost;

평점 및 댓글

—
아직 평점이 없어요 — 첫 평점을 남겨 보세요.
5
0
4
0
3
0
2
0
1
0

평점과 댓글을 남기려면 로그인하세요.

댓글 0개

아직 댓글이 없어요. 이 모델을 어떻게 사용했는지, 어떤 점이 더 나아질 수 있을지 공유해 주세요.

관련 모델

같은 카테고리 또는 비슷한 태그