-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathartifact.js
166 lines (150 loc) · 3.97 KB
/
artifact.js
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
export default {
name: 'Artifact',
slug: 'artifact',
version: 1,
/*
* type
*
* which scene type to load.
* -1 loads src/CustomScene.js
*/
type: -1,
/*
* sky
*
* will load a skybox.jpg file from the glitch cdn
* { type: 'string' }
*/
sky: 'https://cdn.glitch.global/d54910d5-62eb-4e7e-a100-18f881ab74c4/default.jpg?v=1678892582446',
/*
* will load a glb file from the glitch cdn
* { type: 'string' }
*/
file: 'https://cdn.glitch.global/d54910d5-62eb-4e7e-a100-18f881ab74c4/theinternetsownboy.glb?v=1678891896217',
/*
* cam
* the initial camera position
* { type: 'vector3' }
*/
cam: {
// x: 0,
y: 1.7,
// z: -3,
},
/*
* lookat
* the position the camera looks at and rotates around
* { type: 'Vector3' }
*/
lookat: {
// x: 0,
y: 1.7,
// z: 0,
},
/*
* clip
* when clip is true, all objects in the glb file that have "clip" in their name
* will become clipping objects. this allows making part of the scene they obstruct invisible.
* { type: 'boolean }
*/
// clip: true,
/*
* frustumCulled
*
* Objects with animations will get frustum culled too early in augmented reality.
* Try this option if parts of your object disappear when you get too close to them.
* { type: 'boolean' }
*/
// frustumCulled: false,
/*
* nosort
*
* Multiple overlapping transparent objects cause problems
* when the camera rotates around them.
* The z-index seems to "jump",
* because three.js calculates z-depth based on position of objects.
* nosort sometimes helps to avoid this effect.
*/
// nosort: true,
/*
* audio
*
* loads a audio file from cdn.glitch.com and starts playing it when the scene starts.
* { type: 'string', default: undefined }
*/
// audio: 'https://cdn.glitch.global/...',
/*
* video
*
* loads a video file from cdn.glitch.com and projects it onto an object in the gltf file.
* mesh object has to be named "videotarget" and should have as few vertices as possible.
* uv mapping can be used to spread one video over multiple meshes.
* { type: 'string', default: undefined }
*/
// video: 'https://cdn.glitch.global/...',
/*
* chromaKey (greenscreen)
*
* use greenscreen on the video material of your 3d object.
* can be set to true to use 0xd432 (greenscreen green in hex color format),
* which is the default green.
* can be set to any css color too (#ff0000, 'red')
* { type: ['string', 'number', 'boolean'], default: false,}
*/
// chromaKey: true, // 0xd432,
/*
* hideLight
*
* Uncomment this setting to completely disable the threejs lights.
* This can help if you want to completely control the lighting via glb.
* { type: 'boolean', default: false }
*/
// hideLight: true,
/*
* loop
*
* Uncomment this setting to false to stop animations from looping.
* { type: 'boolean', default: true }
*/
// loop: false,
/*
* loopVideo
*
* Uncomment this setting to false to stop videos after playing once
* { type: 'boolean', default: true }
*/
// loopVideo: false,
/*
* animations
* controls animation playback and various other settings
* { type: 'object' }
*/
animations: {
/*
* should animations loop?
* { type: 'boolean', default: true }
*/
// loop: false,
/*
* should animations autoplay?
* { type: 'boolean', default: true }
*/
// autoplay: false,
/*
* when animations are not looping, they usually should clamp when finished.
* { type: 'boolean' }
*/
// clampWhenFinished: true,
/*
* a list of animation names that should not be looping
* { type: 'array', itemType: 'string' }
*/
// noLoopAnimations: ['noLoopAnimationName'],
/*
* a list of paused animations
* can be used to programatically start animations
* { type: 'array', itemType: 'string' }
*/
// pausedAnimations: ['pausedAnimationName'],
},
}