Skip to content

Commit

Permalink
Renamed (WW)OBJLoader2Verify to (WW)OBJLoader2Example.
Browse files Browse the repository at this point in the history
Fixed some code formatting.
  • Loading branch information
kaisalmen committed Feb 16, 2017
1 parent 8b739e3 commit 8963b64
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
36 changes: 18 additions & 18 deletions examples/webgl_loader_obj2.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@

'use strict';

var OBJLoader2Verify = (function () {
var OBJLoader2Example = (function () {

function OBJLoader2Verify( elementToBindTo ) {
function OBJLoader2Example( elementToBindTo ) {
this.renderer = null;
this.canvas = elementToBindTo;
this.aspectRatio = 1;
Expand Down Expand Up @@ -134,7 +134,7 @@
};
}

OBJLoader2Verify.prototype.initGL = function () {
OBJLoader2Example.prototype.initGL = function () {
this.renderer = new THREE.WebGLRenderer( {
canvas: this.canvas,
antialias: true,
Expand Down Expand Up @@ -170,7 +170,7 @@
this.scene.add( this.pivot );
};

OBJLoader2Verify.prototype.initPostGL = function () {
OBJLoader2Example.prototype.initPostGL = function () {
var scope = this;

var mtlLoader = new THREE.MTLLoader();
Expand Down Expand Up @@ -211,7 +211,7 @@
return true;
};

OBJLoader2Verify.prototype.resizeDisplayGL = function () {
OBJLoader2Example.prototype.resizeDisplayGL = function () {
this.controls.handleResize();

this.recalcAspectRatio();
Expand All @@ -220,24 +220,24 @@
this.updateCamera();
};

OBJLoader2Verify.prototype.recalcAspectRatio = function () {
OBJLoader2Example.prototype.recalcAspectRatio = function () {
this.aspectRatio = ( this.canvas.offsetHeight === 0 ) ? 1 : this.canvas.offsetWidth / this.canvas.offsetHeight;
};

OBJLoader2Verify.prototype.resetCamera = function () {
OBJLoader2Example.prototype.resetCamera = function () {
this.camera.position.copy( this.cameraDefaults.posCamera );
this.cameraTarget.copy( this.cameraDefaults.posCameraTarget );

this.updateCamera();
};

OBJLoader2Verify.prototype.updateCamera = function () {
OBJLoader2Example.prototype.updateCamera = function () {
this.camera.aspect = this.aspectRatio;
this.camera.lookAt( this.cameraTarget );
this.camera.updateProjectionMatrix();
};

OBJLoader2Verify.prototype.render = function () {
OBJLoader2Example.prototype.render = function () {
if ( ! this.renderer.autoClear ) this.renderer.clear();

this.controls.update();
Expand All @@ -248,7 +248,7 @@
this.renderer.render( this.scene, this.camera );
};

OBJLoader2Verify.prototype.alterSmoothShading = function () {
OBJLoader2Example.prototype.alterSmoothShading = function () {

var scope = this;
scope.smoothShading = ! scope.smoothShading;
Expand All @@ -269,7 +269,7 @@
scope.pivot.traverse( scopeTraverse );
};

OBJLoader2Verify.prototype.alterDouble = function () {
OBJLoader2Example.prototype.alterDouble = function () {

var scope = this;
scope.doubleSide = ! scope.doubleSide;
Expand All @@ -290,13 +290,13 @@
scope.pivot.traverse( scopeTraverse );
};

OBJLoader2Verify.prototype.traverseScene = function ( object3d ) {
OBJLoader2Example.prototype.traverseScene = function ( object3d ) {

if ( object3d.material instanceof THREE.MultiMaterial ) {

for ( var matName in object3d.material.materials ) {

this.traversalFunction( object3d.material.materials[matName] );
this.traversalFunction( object3d.material.materials[ matName ] );

}

Expand All @@ -308,24 +308,24 @@

};

return OBJLoader2Verify;
return OBJLoader2Example;

})();

var app = new OBJLoader2Verify( document.getElementById( 'example' ) );
var app = new OBJLoader2Example( document.getElementById( 'example' ) );

var resizeWindow = function () {
app.resizeDisplayGL();
};

var render = function () {
requestAnimationFrame(render);
requestAnimationFrame( render );
app.render();
};

window.addEventListener('resize', resizeWindow, false);
window.addEventListener( 'resize', resizeWindow, false );

console.log("Starting initialisation phase...");
console.log( 'Starting initialisation phase...' );
app.initGL();
app.resizeDisplayGL();
app.initPostGL();
Expand Down
36 changes: 18 additions & 18 deletions examples/webgl_loader_obj2_ww.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@

'use strict';

var WWOBJLoader2Verify = (function () {
var WWOBJLoader2Example = (function () {

function WWOBJLoader2Verify( elementToBindTo ) {
function WWOBJLoader2Example( elementToBindTo ) {
this.renderer = null;
this.canvas = elementToBindTo;
this.aspectRatio = 1;
Expand Down Expand Up @@ -135,7 +135,7 @@
};
}

WWOBJLoader2Verify.prototype.initGL = function () {
WWOBJLoader2Example.prototype.initGL = function () {
this.renderer = new THREE.WebGLRenderer( {
canvas: this.canvas,
antialias: true,
Expand Down Expand Up @@ -171,7 +171,7 @@
this.scene.add( this.pivot );
};

WWOBJLoader2Verify.prototype.initPostGL = function () {
WWOBJLoader2Example.prototype.initPostGL = function () {
var wwObjLoader2 = new THREE.OBJLoader2.WWOBJLoader2();
wwObjLoader2.setCrossOrigin( 'anonymous' );

Expand Down Expand Up @@ -202,7 +202,7 @@
return true;
};

WWOBJLoader2Verify.prototype.resizeDisplayGL = function () {
WWOBJLoader2Example.prototype.resizeDisplayGL = function () {
this.controls.handleResize();

this.recalcAspectRatio();
Expand All @@ -211,24 +211,24 @@
this.updateCamera();
};

WWOBJLoader2Verify.prototype.recalcAspectRatio = function () {
WWOBJLoader2Example.prototype.recalcAspectRatio = function () {
this.aspectRatio = ( this.canvas.offsetHeight === 0 ) ? 1 : this.canvas.offsetWidth / this.canvas.offsetHeight;
};

WWOBJLoader2Verify.prototype.resetCamera = function () {
WWOBJLoader2Example.prototype.resetCamera = function () {
this.camera.position.copy( this.cameraDefaults.posCamera );
this.cameraTarget.copy( this.cameraDefaults.posCameraTarget );

this.updateCamera();
};

WWOBJLoader2Verify.prototype.updateCamera = function () {
WWOBJLoader2Example.prototype.updateCamera = function () {
this.camera.aspect = this.aspectRatio;
this.camera.lookAt( this.cameraTarget );
this.camera.updateProjectionMatrix();
};

WWOBJLoader2Verify.prototype.render = function () {
WWOBJLoader2Example.prototype.render = function () {
if ( ! this.renderer.autoClear ) this.renderer.clear();

this.controls.update();
Expand All @@ -239,7 +239,7 @@
this.renderer.render( this.scene, this.camera );
};

WWOBJLoader2Verify.prototype.alterSmoothShading = function () {
WWOBJLoader2Example.prototype.alterSmoothShading = function () {

var scope = this;
scope.smoothShading = ! scope.smoothShading;
Expand All @@ -260,7 +260,7 @@
scope.pivot.traverse( scopeTraverse );
};

WWOBJLoader2Verify.prototype.alterDouble = function () {
WWOBJLoader2Example.prototype.alterDouble = function () {

var scope = this;
scope.doubleSide = ! scope.doubleSide;
Expand All @@ -281,13 +281,13 @@
scope.pivot.traverse( scopeTraverse );
};

WWOBJLoader2Verify.prototype.traverseScene = function ( object3d ) {
WWOBJLoader2Example.prototype.traverseScene = function ( object3d ) {

if ( object3d.material instanceof THREE.MultiMaterial ) {

for ( var matName in object3d.material.materials ) {

this.traversalFunction( object3d.material.materials[matName] );
this.traversalFunction( object3d.material.materials[ matName ] );

}

Expand All @@ -299,25 +299,25 @@

};

return WWOBJLoader2Verify;
return WWOBJLoader2Example;

})();


var app = new WWOBJLoader2Verify( document.getElementById( 'example' ) );
var app = new WWOBJLoader2Example( document.getElementById( 'example' ) );

var resizeWindow = function () {
app.resizeDisplayGL();
};

var render = function () {
requestAnimationFrame(render);
requestAnimationFrame( render) ;
app.render();
};

window.addEventListener('resize', resizeWindow, false);
window.addEventListener( 'resize', resizeWindow, false );

console.log("Starting initialisation phase...");
console.log( 'Starting initialisation phase...' );
app.initGL();
app.resizeDisplayGL();
app.initPostGL();
Expand Down
6 changes: 3 additions & 3 deletions examples/webgl_loader_obj2_ww_parallels.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@
};

var render = function () {
requestAnimationFrame(render);
requestAnimationFrame( render );
app.render();
};

window.addEventListener('resize', resizeWindow, false);
window.addEventListener( 'resize', resizeWindow, false );

console.log("Starting initialisation phase...");
console.log( 'Starting initialisation phase...' );
app.initGL();
app.resizeDisplayGL();

Expand Down

0 comments on commit 8963b64

Please sign in to comment.