@@ -346,20 +346,41 @@ THREE.PLYLoader.prototype = {
346
346
} else if ( elementName === "face" ) {
347
347
348
348
var vertex_indices = element . vertex_indices ;
349
+ var texcoord = element . texcoord ;
349
350
350
351
if ( vertex_indices . length === 3 ) {
351
352
352
353
geometry . faces . push (
353
354
new THREE . Face3 ( vertex_indices [ 0 ] , vertex_indices [ 1 ] , vertex_indices [ 2 ] )
354
355
) ;
355
356
357
+ if ( texcoord ) {
358
+ geometry . faceVertexUvs [ 0 ] . push ( [
359
+ new THREE . Vector2 ( texcoord [ 0 ] , texcoord [ 1 ] ) ,
360
+ new THREE . Vector2 ( texcoord [ 2 ] , texcoord [ 3 ] ) ,
361
+ new THREE . Vector2 ( texcoord [ 4 ] , texcoord [ 5 ] )
362
+ ] ) ;
363
+ }
364
+
356
365
} else if ( vertex_indices . length === 4 ) {
357
366
358
367
geometry . faces . push (
359
368
new THREE . Face3 ( vertex_indices [ 0 ] , vertex_indices [ 1 ] , vertex_indices [ 3 ] ) ,
360
369
new THREE . Face3 ( vertex_indices [ 1 ] , vertex_indices [ 2 ] , vertex_indices [ 3 ] )
361
370
) ;
362
371
372
+ if ( texcoord ) {
373
+ geometry . faceVertexUvs [ 0 ] . push ( [
374
+ new THREE . Vector2 ( texcoord [ 0 ] , texcoord [ 1 ] ) ,
375
+ new THREE . Vector2 ( texcoord [ 2 ] , texcoord [ 3 ] ) ,
376
+ new THREE . Vector2 ( texcoord [ 6 ] , texcoord [ 7 ] )
377
+ ] , [
378
+ new THREE . Vector2 ( texcoord [ 2 ] , texcoord [ 3 ] ) ,
379
+ new THREE . Vector2 ( texcoord [ 4 ] , texcoord [ 5 ] ) ,
380
+ new THREE . Vector2 ( texcoord [ 6 ] , texcoord [ 7 ] )
381
+ ] ) ;
382
+ }
383
+
363
384
}
364
385
365
386
}
0 commit comments