-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.html
98 lines (81 loc) · 3.15 KB
/
conf.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!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>KT 융합기술원 - 타운홀 세미나</title>
</head>
<body>
<video
id = 'video'
playsinLine
webkit-playsinLine
loop
autoplay
width="1290"
height="760"
src = "./asset/meta.mp4"
style="display: none"
></video>
<script type="module">
import * as THREE from 'https://cdn.skypack.dev/three@0.135.0/build/three.module.js'
import { OrbitControls } from 'https://cdn.skypack.dev/three@0.135.0/examples/jsm/controls/OrbitControls.js'
import { FBXLoader } from 'https://cdn.skypack.dev/three@0.135.0/examples/jsm/loaders/FBXLoader.js'
import Stats from 'https://cdn.skypack.dev/three@0.135.0/examples/jsm/libs/stats.module.js'
//scene
const scene = new THREE.Scene();
//camera
const camera = new THREE.PerspectiveCamera(
60,
window.innerWidth / window.innerHeight,
0.1,
20000
);
camera.position.set(10,3,36);
camera.lookAt(0,0,0);
const renderer = new THREE.WebGLRenderer({antialias: true })
renderer.setSize(window.innerWidth, window.innerHeight)
renderer.setPixelRatio(window.devicePixelRatio);
document.body.appendChild(renderer.domElement)
let video = document.getElementById("video");
let videoTexture = new THREE.VideoTexture(video);
videoTexture.minFilter = THREE.LinearFilter;
videoTexture.magFilter = THREE.LinearFilter;
var movieMaterial = new THREE.MeshBasicMaterial({
map : videoTexture,
side : THREE.FrontSide,
toneMapped : false,
});
let movieGeometry = new THREE.BoxGeometry(100,100,100);
let movieCubeScreen = new THREE.Mesh(movieGeometry, movieMaterial);
movieCubeScreen.position.set(0,50,0);
scene.add(movieCubeScreen);
camera.position.set(0,150,300);
camera.lookAt(movieCubeScreen.position);
const controls = new OrbitControls(camera, renderer.domElement);
animate();
function animate() {
requestAnimationFrame(animate);
controls.update();
videoTexture.needsUpdate = true;
renderer.render(scene, camera);
}
document.onkeydown = function(e) {
if (e.keyCode === 80) {
//p
video.play();
} else if (e.keyCode === 32) {
//space
video.pause();
} else if (e.keyCode === 83) {
//s
video.stop();
} else if (e.keyCode === 82) {
//r
video.currentTime = 0;
}
}
</script>
</body>
</html>