티스토리 뷰
- index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>03 - Basic Scene</title> </head> <body> <canvas class="webgl"></canvas> <script src="./three.min.js"></script> <script src="./script.js"></script> </body> </html>
- script.js
const scene = new THREE.Scene();
// Red cube
const geometry = new THREE.BoxGeometry(1, 1, 1); // geometry (the shape)
const material = new THREE.MeshBasicMaterial({ color: 0xff0000 }); // material (how it looks)
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
// Sizes
const sizes = {
width: 800,
height: 600,
};
// Camera
const camera = new THREE.PerspectiveCamera(75, sizes.width / sizes.height);
// first param : the field of view (fov) vertical vision angle 광각 표준 망원, degree로 표현
// second param : the aspect ratio 화면비, 가로 / 세로
camera.position.z = 3; // z going backwards, it takes our camera out of the box
//camera.position.x = 2; // x going right
//camera.position.y = 2; // y going up
scene.add(camera);
// Renderer
const canvas = document.querySelector(".webgl");
const renderer = new THREE.WebGLRenderer({
canvas: canvas,
});
renderer.setSize(sizes.width, sizes.height);
renderer.render(scene, camera);

'code > three.js' 카테고리의 다른 글
| 06. Animations (0) | 2021.07.02 |
|---|---|
| 05. Transform objects (0) | 2021.06.27 |
| What is WebGL? (0) | 2021.06.27 |
| Three.js journey 시작! (0) | 2021.06.26 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- CPU Scheduler
- dmacontroller
- 부모-자식 프로세스
- nomorecramming
- deadlock prevention
- deadlock ignorance
- Program Counter
- deadlock avoidance
- process control block
- multiple-processer scheduling
- multiprogramming
- devicecontroller
- CPU burst
- I/O burst
- 혹시이런거쓰면문제유출인가요
- timesharing
- Semaphores
- 문제가된다면삭제하겠습니다
- real time scheduling
- process context
- Copy on Write
- message system
- test and set
- modebit
- docxtemplater
- Peterson's Algorithm
- deadlock detection and recovery
- exec()
- shortest job first
- i/odevice
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |
글 보관함
