File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,15 @@ class ThreeCanvas {
18
18
private composer : THREE . Composer ;
19
19
private camera : THREE . Camera ;
20
20
private cubeGroup : THREE . Group ;
21
+ private clock : THREE . Clock ;
21
22
22
23
constructor ( options : IOptions ) {
23
24
const { mountPoint, width, height } = options ;
24
25
25
26
// this is just here for reference. most of this file should be overwritten :)
26
27
27
28
// basics
29
+ const clock = this . clock = new THREE . Clock ( ) ;
28
30
const scene = new THREE . Scene ( ) ;
29
31
const camera = this . camera = new THREE . PerspectiveCamera ( 75 , width / height , 0.1 , 1000 ) ;
30
32
const renderer = this . renderer = new THREE . WebGLRenderer ( {
@@ -106,6 +108,8 @@ class ThreeCanvas {
106
108
this . camera . updateProjectionMatrix ( ) ;
107
109
}
108
110
111
+ this . cubeGroup . rotation . y = this . clock . getElapsedTime ( ) ;
112
+
109
113
this . composer . render ( ) ;
110
114
}
111
115
}
You can’t perform that action at this time.
0 commit comments