Skip to content

Commit

Permalink
Fixed VRMLLoader example. See #3728.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Aug 14, 2013
1 parent a94ddae commit 0531956
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions examples/js/loaders/VRMLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ THREE.VRMLLoader.prototype = {

scope.dispatchEvent( { type: 'load', content: object } );

if ( callback ) callback( geometry );

}, false );

request.addEventListener( 'progress', function ( event ) {
Expand Down
8 changes: 2 additions & 6 deletions examples/webgl_loader_vrml.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
function init() {

camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 0.01, 1e10 );
camera.position.z = 0.2;
camera.position.z = 6;

controls = new THREE.TrackballControls( camera );

Expand Down Expand Up @@ -88,11 +88,7 @@
var loader = new THREE.VRMLLoader();
loader.addEventListener( 'load', function ( event ) {

var geometry = event.content;

var mesh = new THREE.Mesh( geometry, material );
mesh.position.setY( - 0.09 );
scene.add( mesh );
scene = event.content;

} );
loader.load( "models/vrml/simple.wrl" );
Expand Down

2 comments on commit 0531956

@bartmcleod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix broke the lighting of the scene, because the scene is overwritten. This can be solved by adding camera and lighting after the scene is re-assigned from event.content.

There are also some regexes in the loader that need fixing. The loader currently breaks if a transparency is specified. I forked this repo, hope to be able to create a pull request tomorrow. I would like to work on importing IndexedFaceSet. Any ideas on this?

@mrdoob
Copy link
Owner Author

@mrdoob mrdoob commented on 0531956 Oct 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also some regexes in the loader that need fixing. The loader currently breaks if a transparency is specified. I forked this repo, hope to be able to create a pull request tomorrow. I

Sweet!

I would like to work on importing IndexedFaceSet. Any ideas on this?

Nope... :/

Please sign in to comment.