JavaScript

threejs 질문입니다

wa

want_kurzweil
답변 대기중
30 XP
import * as THREE from 'three';

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ alpha: true });

renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById('home3dContent').appendChild(renderer.domElement);

const geometry = new THREE.DodecahedronGeometry(2);
const material = new THREE.PointsMaterial({ size: 0.02, color: 0x00ff00 });
const points = new THREE.Points(geometry, material);
scene.add(points);

camera.position.z = 5;

function animate() {
  requestAnimationFrame(animate);

  points.rotation.x += 0.005;
  points.rotation.y += 0.005;

  renderer.render(scene, camera);
}

animate();

정 12면체에 각 꼭짓점마다 텍스트를 추가하고 싶은데 어떤 방식으로 해야될까요?


불러오는 중...