Skip to content

Commit

Permalink
Merge pull request #12755 from WestLangley/dev-mesh_scale
Browse files Browse the repository at this point in the history
Examples: Apply negative scale to geometry instead of mesh
  • Loading branch information
mrdoob authored Nov 27, 2017
2 parents 335d7ab + 280b377 commit 1acde35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions examples/canvas_geometry_panorama.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@

];

mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), materials );
mesh.scale.x = - 1;
var geometry = new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 );
geometry.scale( - 1, 1, 1 );

mesh = new THREE.Mesh( geometry, materials );
scene.add( mesh );

renderer = new THREE.CanvasRenderer();
Expand Down
6 changes: 4 additions & 2 deletions examples/canvas_geometry_panorama_fisheye.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@

];

mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), materials );
mesh.scale.x = - 1;
var geometry = new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 );
geometry.scale( - 1, 1, 1 );

mesh = new THREE.Mesh( geometry, materials );
scene.add( mesh );

for ( var i = 0, l = mesh.geometry.vertices.length; i < l; i ++ ) {
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_materials_cubemap_dynamic2.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
scene = new THREE.Scene();

var mesh = new THREE.Mesh( new THREE.SphereBufferGeometry( 500, 32, 16 ), new THREE.MeshBasicMaterial( { map: texture } ) );
mesh.scale.x = -1;
mesh.geometry.scale( - 1, 1, 1 );
scene.add( mesh );

renderer = new THREE.WebGLRenderer( { antialias: true } );
Expand Down

0 comments on commit 1acde35

Please sign in to comment.