Ver código fonte

Update versions

customisations
alemart 1 ano atrás
pai
commit
6623e10c8d

+ 0
- 183
demos/assets/FontLoader.js Ver arquivo

@@ -1,183 +0,0 @@
1
-( function () {
2
-
3
-	class FontLoader extends THREE.Loader {
4
-
5
-		constructor( manager ) {
6
-
7
-			super( manager );
8
-
9
-		}
10
-
11
-		load( url, onLoad, onProgress, onError ) {
12
-
13
-			const scope = this;
14
-			const loader = new THREE.FileLoader( this.manager );
15
-			loader.setPath( this.path );
16
-			loader.setRequestHeader( this.requestHeader );
17
-			loader.setWithCredentials( scope.withCredentials );
18
-			loader.load( url, function ( text ) {
19
-
20
-				let json;
21
-
22
-				try {
23
-
24
-					json = JSON.parse( text );
25
-
26
-				} catch ( e ) {
27
-
28
-					console.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' );
29
-					json = JSON.parse( text.substring( 65, text.length - 2 ) );
30
-
31
-				}
32
-
33
-				const font = scope.parse( json );
34
-				if ( onLoad ) onLoad( font );
35
-
36
-			}, onProgress, onError );
37
-
38
-		}
39
-
40
-		parse( json ) {
41
-
42
-			return new Font( json );
43
-
44
-		}
45
-
46
-	} //
47
-
48
-
49
-	class Font {
50
-
51
-		constructor( data ) {
52
-
53
-			this.type = 'Font';
54
-			this.data = data;
55
-
56
-		}
57
-
58
-		generateShapes( text, size = 100 ) {
59
-
60
-			const shapes = [];
61
-			const paths = createPaths( text, size, this.data );
62
-
63
-			for ( let p = 0, pl = paths.length; p < pl; p ++ ) {
64
-
65
-				Array.prototype.push.apply( shapes, paths[ p ].toShapes() );
66
-
67
-			}
68
-
69
-			return shapes;
70
-
71
-		}
72
-
73
-	}
74
-
75
-	function createPaths( text, size, data ) {
76
-
77
-		const chars = Array.from( text );
78
-		const scale = size / data.resolution;
79
-		const line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale;
80
-		const paths = [];
81
-		let offsetX = 0,
82
-			offsetY = 0;
83
-
84
-		for ( let i = 0; i < chars.length; i ++ ) {
85
-
86
-			const char = chars[ i ];
87
-
88
-			if ( char === '\n' ) {
89
-
90
-				offsetX = 0;
91
-				offsetY -= line_height;
92
-
93
-			} else {
94
-
95
-				const ret = createPath( char, scale, offsetX, offsetY, data );
96
-				offsetX += ret.offsetX;
97
-				paths.push( ret.path );
98
-
99
-			}
100
-
101
-		}
102
-
103
-		return paths;
104
-
105
-	}
106
-
107
-	function createPath( char, scale, offsetX, offsetY, data ) {
108
-
109
-		const glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
110
-
111
-		if ( ! glyph ) {
112
-
113
-			console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' );
114
-			return;
115
-
116
-		}
117
-
118
-		const path = new THREE.ShapePath();
119
-		let x, y, cpx, cpy, cpx1, cpy1, cpx2, cpy2;
120
-
121
-		if ( glyph.o ) {
122
-
123
-			const outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) );
124
-
125
-			for ( let i = 0, l = outline.length; i < l; ) {
126
-
127
-				const action = outline[ i ++ ];
128
-
129
-				switch ( action ) {
130
-
131
-					case 'm':
132
-						// moveTo
133
-						x = outline[ i ++ ] * scale + offsetX;
134
-						y = outline[ i ++ ] * scale + offsetY;
135
-						path.moveTo( x, y );
136
-						break;
137
-
138
-					case 'l':
139
-						// lineTo
140
-						x = outline[ i ++ ] * scale + offsetX;
141
-						y = outline[ i ++ ] * scale + offsetY;
142
-						path.lineTo( x, y );
143
-						break;
144
-
145
-					case 'q':
146
-						// quadraticCurveTo
147
-						cpx = outline[ i ++ ] * scale + offsetX;
148
-						cpy = outline[ i ++ ] * scale + offsetY;
149
-						cpx1 = outline[ i ++ ] * scale + offsetX;
150
-						cpy1 = outline[ i ++ ] * scale + offsetY;
151
-						path.quadraticCurveTo( cpx1, cpy1, cpx, cpy );
152
-						break;
153
-
154
-					case 'b':
155
-						// bezierCurveTo
156
-						cpx = outline[ i ++ ] * scale + offsetX;
157
-						cpy = outline[ i ++ ] * scale + offsetY;
158
-						cpx1 = outline[ i ++ ] * scale + offsetX;
159
-						cpy1 = outline[ i ++ ] * scale + offsetY;
160
-						cpx2 = outline[ i ++ ] * scale + offsetX;
161
-						cpy2 = outline[ i ++ ] * scale + offsetY;
162
-						path.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy );
163
-						break;
164
-
165
-				}
166
-
167
-			}
168
-
169
-		}
170
-
171
-		return {
172
-			offsetX: glyph.ha * scale,
173
-			path: path
174
-		};
175
-
176
-	}
177
-
178
-	Font.prototype.isFont = true;
179
-
180
-	THREE.Font = Font;
181
-	THREE.FontLoader = FontLoader;
182
-
183
-} )();

+ 0
- 4010
demos/assets/GLTFLoader.js
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 0
- 51
demos/assets/TextGeometry.js Ver arquivo

@@ -1,51 +0,0 @@
1
-( function () {
2
-
3
-	/**
4
- * Text = 3D Text
5
- *
6
- * parameters = {
7
- *  font: <THREE.Font>, // font
8
- *
9
- *  size: <float>, // size of the text
10
- *  height: <float>, // thickness to extrude text
11
- *  curveSegments: <int>, // number of points on the curves
12
- *
13
- *  bevelEnabled: <bool>, // turn on bevel
14
- *  bevelThickness: <float>, // how deep into text bevel goes
15
- *  bevelSize: <float>, // how far from text outline (including bevelOffset) is bevel
16
- *  bevelOffset: <float> // how far from text outline does bevel start
17
- * }
18
- */
19
-
20
-	class TextGeometry extends THREE.ExtrudeGeometry {
21
-
22
-		constructor( text, parameters = {} ) {
23
-
24
-			const font = parameters.font;
25
-
26
-			if ( font === undefined ) {
27
-
28
-				super(); // generate default extrude geometry
29
-
30
-			} else {
31
-
32
-				const shapes = font.generateShapes( text, parameters.size ); // translate parameters to THREE.ExtrudeGeometry API
33
-
34
-				parameters.depth = parameters.height !== undefined ? parameters.height : 50; // defaults
35
-
36
-				if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10;
37
-				if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8;
38
-				if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false;
39
-				super( shapes, parameters );
40
-
41
-			}
42
-
43
-			this.type = 'TextGeometry';
44
-
45
-		}
46
-
47
-	}
48
-
49
-	THREE.TextGeometry = TextGeometry;
50
-
51
-} )();

+ 2
- 2
demos/assets/aframe-particle-system-component.js Ver arquivo

@@ -2281,7 +2281,7 @@
2281 2281
 	    options.texture = utils.ensureTypedArg( options.texture, types.OBJECT, {} );
2282 2282
 
2283 2283
 	    // Assign a UUID to this instance
2284
-	    this.uuid = THREE.Math.generateUUID();
2284
+	    this.uuid = THREE.MathUtils.generateUUID();
2285 2285
 
2286 2286
 	    // If no `deltaTime` value is passed to the `SPE.Group.tick` function,
2287 2287
 	    // the value of this property will be used to advance the simulation.
@@ -3143,7 +3143,7 @@
3143 3143
 	        console.warn( 'onParticleSpawn has been removed. Please set properties directly to alter values at runtime.' );
3144 3144
 	    }
3145 3145
 
3146
-	    this.uuid = THREE.Math.generateUUID();
3146
+	    this.uuid = THREE.MathUtils.generateUUID();
3147 3147
 
3148 3148
 	    this.type = utils.ensureTypedArg( options.type, types.NUMBER, SPE.distributions.BOX );
3149 3149
 

+ 2
- 2
demos/assets/aframe-particle-system-component.min.js
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 2
- 2
demos/assets/aframe-with-martins.js Ver arquivo

@@ -7,8 +7,8 @@
7 7
 
8 8
 /* Usage of the indicated versions is encouraged */
9 9
 __THIS_GLUE_CODE_HAS_BEEN_TESTED_WITH__({
10
-    'MARTINS.js': { version: '0.1.2' },
11
-        'AFRAME': { version: '1.3.0' }
10
+    'MARTINS.js': { version: '0.2.0' },
11
+        'AFRAME': { version: '1.4.2' }
12 12
 });
13 13
 
14 14
 /**

+ 2
- 2
demos/assets/three-with-martins.js Ver arquivo

@@ -7,8 +7,8 @@
7 7
 
8 8
 /* Usage of the indicated versions is encouraged */
9 9
 __THIS_GLUE_CODE_HAS_BEEN_TESTED_WITH__({
10
-    'MARTINS.js': { version: '0.1.2' },
11
-      'THREE.js': { version: '138' }
10
+    'MARTINS.js': { version: '0.2.0' },
11
+      'THREE.js': { version: '147' }
12 12
 });
13 13
 
14 14
 /**

+ 1
- 1
demos/hello-aframe/index.html Ver arquivo

@@ -6,7 +6,7 @@
6 6
         <title>MARTINS.js WebAR demo with A-Frame</title>
7 7
         <link href="demo.css" rel="stylesheet">
8 8
         <script src="../../dist/martins.js"></script>
9
-        <script src="https://cdn.jsdelivr.net/npm/aframe@1.3.0/dist/aframe-v1.3.0.min.js"></script>
9
+        <script src="https://cdn.jsdelivr.net/npm/aframe@1.4.2/dist/aframe-v1.4.2.min.js"></script>
10 10
         <script src="../assets/aframe-particle-system-component.min.js"></script>
11 11
         <script src="demo.js"></script>
12 12
         <script src="../assets/aframe-with-martins.js"></script>

+ 1
- 1
demos/hello-aframe/video.html Ver arquivo

@@ -6,7 +6,7 @@
6 6
         <title>MARTINS.js WebAR demo with A-Frame</title>
7 7
         <link href="demo.css" rel="stylesheet">
8 8
         <script src="../../dist/martins.js"></script>
9
-        <script src="https://cdn.jsdelivr.net/npm/aframe@1.3.0/dist/aframe-v1.3.0.min.js"></script>
9
+        <script src="https://cdn.jsdelivr.net/npm/aframe@1.4.2/dist/aframe-v1.4.2.min.js"></script>
10 10
         <script src="../assets/aframe-particle-system-component.min.js"></script>
11 11
         <script src="demo.js"></script>
12 12
         <script src="../assets/aframe-with-martins.js"></script>

+ 2
- 2
demos/hello-three/index.html Ver arquivo

@@ -6,8 +6,8 @@
6 6
         <title>MARTINS.js WebAR demo with three.js</title>
7 7
         <link href="demo.css" rel="stylesheet">
8 8
         <script src="../../dist/martins.js"></script>
9
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/build/three.min.js"></script>
10
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/examples/js/loaders/GLTFLoader.js"></script>
9
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/build/three.min.js"></script>
10
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/examples/js/loaders/GLTFLoader.js"></script>
11 11
         <script src="../assets/three-with-martins.js"></script>
12 12
         <script src="demo.js"></script>
13 13
     </head>

+ 2
- 2
demos/hello-three/video.html Ver arquivo

@@ -6,8 +6,8 @@
6 6
         <title>MARTINS.js WebAR demo with three.js</title>
7 7
         <link href="demo.css" rel="stylesheet">
8 8
         <script src="../../dist/martins.js"></script>
9
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/build/three.min.js"></script>
10
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/examples/js/loaders/GLTFLoader.js"></script>
9
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/build/three.min.js"></script>
10
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/examples/js/loaders/GLTFLoader.js"></script>
11 11
         <script src="../assets/three-with-martins.js"></script>
12 12
         <script src="demo.js"></script>
13 13
     </head>

+ 3
- 3
demos/touch-three/index.html Ver arquivo

@@ -6,9 +6,9 @@
6 6
         <title>MARTINS.js WebAR demo with three.js and touch interaction</title>
7 7
         <link href="demo.css" rel="stylesheet">
8 8
         <script src="../../dist/martins.js"></script>
9
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/build/three.min.js"></script>
10
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/examples/js/loaders/FontLoader.js"></script>
11
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/examples/js/geometries/TextGeometry.js"></script>
9
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/build/three.min.js"></script>
10
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/examples/js/loaders/FontLoader.js"></script>
11
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/examples/js/geometries/TextGeometry.js"></script>
12 12
         <script src="../assets/three-with-martins.js"></script>
13 13
         <script src="demo.js"></script>
14 14
     </head>

+ 3
- 3
demos/touch-three/video.html Ver arquivo

@@ -6,9 +6,9 @@
6 6
         <title>MARTINS.js WebAR demo with three.js and touch interaction</title>
7 7
         <link href="demo.css" rel="stylesheet">
8 8
         <script src="../../dist/martins.js"></script>
9
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/build/three.min.js"></script>
10
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/examples/js/loaders/FontLoader.js"></script>
11
-        <script src="https://cdn.jsdelivr.net/npm/three@0.138.3/examples/js/geometries/TextGeometry.js"></script>
9
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/build/three.min.js"></script>
10
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/examples/js/loaders/FontLoader.js"></script>
11
+        <script src="https://cdn.jsdelivr.net/npm/three@0.147.0/examples/js/geometries/TextGeometry.js"></script>
12 12
         <script src="../assets/three-with-martins.js"></script>
13 13
         <script src="demo.js"></script>
14 14
     </head>

Carregando…
Cancelar
Salvar