1
1
import { ChangeDetectionStrategy , Component , CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' ;
2
2
import { injectBeforeRender , NgtCanvas } from 'angular-three' ;
3
+ import { injectGLTF } from 'angular-three-soba/loaders' ;
3
4
import { NgtsAccumulativeShadows , NgtsEnvironment , NgtsRandomizedLights } from 'angular-three-soba/staging' ;
4
5
import { Vector3 } from 'three' ;
5
6
import { color , colorAsHex } from './color' ;
6
7
import { Lightformers } from './lightformers' ;
7
8
import { Model } from './model' ;
8
9
10
+ injectGLTF . preload ( ( ) => './911-transformed.glb' ) ;
11
+
9
12
@Component ( {
10
13
standalone : true ,
11
14
template : `
@@ -21,16 +24,20 @@ import { Model } from './model';
21
24
</ngt-spot-light>
22
25
<ngt-ambient-light [intensity]="0.5 * Math.PI" />
23
26
24
- <app-porsche [position]="[-0.5, -0.18, 0]" [rotation]="[0, Math.PI / 5, 0]" [scale]="1.6" />
27
+ <app-porsche-model #model [position]="[-0.5, -0.18, 0]" [rotation]="[0, Math.PI / 5, 0]" [scale]="1.6" />
25
28
26
- <ngts-accumulative-shadows [options]="{ position: [0, -1.16, 0], frames: 100, alphaTest: 0.9, scale: 10 }">
29
+ <ngts-accumulative-shadows
30
+ [options]="{ position: [0, -1.16, 0], frames: 100, alphaTest: 0.9, scale: 10, visible: !!model.gltf() }"
31
+ >
27
32
<ngts-randomized-lights
28
33
[options]="{ amount: 8, radius: 10, ambient: 0.5, position: [1, 5, -1], intensity: 1.5 * Math.PI }"
29
34
/>
30
35
</ngts-accumulative-shadows>
31
36
32
37
<ngts-environment [options]="{ background: true, blur: 1, resolution: 256, frames: Infinity }">
33
- <app-lightformers * />
38
+ <ng-template>
39
+ <app-lightformers />
40
+ </ng-template>
34
41
</ngts-environment>
35
42
` ,
36
43
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
0 commit comments