Skip to content

Commit

Permalink
Examples: Clean up Refractor and Water2 (see mrdoob#12631)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Nov 12, 2017
1 parent 820c61a commit 4a8849d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions examples/js/objects/Water2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*
*/

THREE.Water = function ( width, height, options ) {
THREE.Water = function ( geometry, options ) {

THREE.Mesh.call( this, new THREE.PlaneBufferGeometry( width, height ) );
THREE.Mesh.call( this, geometry );

this.type = 'Water';

Expand Down Expand Up @@ -54,13 +54,13 @@ THREE.Water = function ( width, height, options ) {

}

var reflector = new THREE.Reflector( width, height, {
var reflector = new THREE.Reflector( geometry, {
textureWidth: textureWidth,
textureHeight: textureHeight,
clipBias: clipBias
} );

var refractor = new THREE.Refractor( width, height, {
var refractor = new THREE.Refractor( geometry, {
textureWidth: textureWidth,
textureHeight: textureHeight,
clipBias: clipBias
Expand Down
4 changes: 3 additions & 1 deletion examples/webgl_refraction.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@

// refractor

refractor = new THREE.Refractor( 10, 10, {
var refractorGeometry = new THREE.PlaneBufferGeometry( 10, 10 );

refractor = new THREE.Refractor( refractorGeometry, {
color: 0x999999,
textureWidth: 1024,
textureHeight: 1024,
Expand Down
4 changes: 3 additions & 1 deletion examples/webgl_water.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@

// water

water = new THREE.Water( 20, 20, {
var waterGeometry = new THREE.PlaneBufferGeometry( 20, 20 );

water = new THREE.Water( waterGeometry, {
color: params.color,
scale: params.scale,
flowDirection: new THREE.Vector2( params.flowX, params.flowY ),
Expand Down
3 changes: 2 additions & 1 deletion examples/webgl_water_flowmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@

// water

var waterGeometry = new THREE.PlaneBufferGeometry( 20, 20 );
var flowMap = textureLoader.load( 'textures/water/Water_1_M_Flow.jpg' );

water = new THREE.Water( 20, 20, {
water = new THREE.Water( waterGeometry, {
scale: 2,
textureWidth: 1024,
textureHeight: 1024,
Expand Down

0 comments on commit 4a8849d

Please sign in to comment.