|
375 | 375 |
|
376 | 376 | cube = new THREE.CubeGeometry( 100, 100, 100, 1, 1, 1, materials, sides );
|
377 | 377 |
|
| 378 | + // revert back to old flipped UVs |
| 379 | + |
| 380 | + for ( i = 0; i < cube.faceVertexUvs[ 0 ].length; i ++ ) { |
| 381 | + |
| 382 | + uv = cube.faceVertexUvs[ 0 ][ i ]; |
| 383 | + |
| 384 | + for ( j = 0; j < uv.length; j++ ) { |
| 385 | + |
| 386 | + uv[j].v = 1 - uv[j].v; |
| 387 | + |
| 388 | + } |
| 389 | + |
| 390 | + } |
| 391 | + |
378 | 392 | // set UV tiles
|
379 | 393 |
|
380 | 394 | for ( i = 0; i < cube.faceVertexUvs[ 0 ].length; i ++ ) {
|
|
496 | 510 | canvas.width = canvas.height = size;
|
497 | 511 |
|
498 | 512 | var texture = new THREE.Texture( canvas, new THREE.UVMapping(), THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.NearestFilter, THREE.LinearMipMapLinearFilter );
|
| 513 | + texture.flipY = false; |
499 | 514 |
|
500 | 515 | function generateTexture() {
|
501 | 516 |
|
|
535 | 550 | canvas.width = canvas.height = size;
|
536 | 551 |
|
537 | 552 | var texture = new THREE.Texture( canvas, new THREE.UVMapping(), THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.NearestFilter, THREE.LinearMipMapLinearFilter );
|
| 553 | + texture.flipY = false; |
538 | 554 |
|
539 | 555 | function generateTexture() {
|
540 | 556 |
|
|
563 | 579 | return new THREE.MeshLambertMaterial( { map: texture } );
|
564 | 580 |
|
565 | 581 | }
|
| 582 | + |
566 | 583 | function generateMegamaterialDebug() {
|
567 | 584 |
|
568 | 585 | var canvas = document.createElement( 'canvas' ),
|
|
576 | 593 | ctx.textBaseline = "top";
|
577 | 594 | ctx.font = "8pt arial";
|
578 | 595 |
|
579 |
| - for ( i = 0; i < tile; i++ ) { |
| 596 | + for ( i = 0; i < tile; i ++ ) { |
580 | 597 |
|
581 |
| - for ( j = 0; j < tile; j++ ) { |
| 598 | + for ( j = 0; j < tile; j ++ ) { |
582 | 599 |
|
583 | 600 | h = i * tile + j;
|
584 | 601 | ctx.fillStyle = "hsl(" + h + ",90%, 50%)";
|
|
645 | 662 | ctx.fillRect( sx + a * i, sy + b * i, width, height );
|
646 | 663 |
|
647 | 664 | }
|
| 665 | + |
648 | 666 | }
|
649 | 667 |
|
650 | 668 | function drawAOSides( ctx, image, row, column, sides, tile, strength, debug_texture, debug_numbers ) {
|
|
0 commit comments