Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ldraw example update #22191

Merged
merged 4 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 0 additions & 121 deletions examples/jsm/environments/LDrawEnvironment.js

This file was deleted.

5 changes: 2 additions & 3 deletions examples/jsm/loaders/LDrawLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,11 @@ class LDrawConditionalLineMaterial extends ShaderMaterial {

} );


this.setValues( parameters );
this.isLDrawConditionalLineMaterial = true;

}


}

function smoothNormals( triangles, lineSegments ) {
Expand Down Expand Up @@ -981,7 +980,7 @@ class LDrawLoader extends Loader {

case FINISH_TYPE_DEFAULT:

material = new MeshStandardMaterial( { color: colour, roughness: 0.3, envMapIntensity: 0.3, metalness: 0 } );
material = new MeshStandardMaterial( { color: colour, roughness: 0.3, metalness: 0 } );
break;

case FINISH_TYPE_PEARLESCENT:
Expand Down
27 changes: 13 additions & 14 deletions examples/webgl_loader_ldraw.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
import { GUI } from './jsm/libs/dat.gui.module.js';

import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { LDrawEnvironment } from './jsm/environments/LDrawEnvironment.js';
import { RoomEnvironment } from './jsm/environments/RoomEnvironment.js';

import { LDrawLoader } from './jsm/loaders/LDrawLoader.js';

let container, progressBarDiv;

let camera, scene, renderer, controls, gui, guiData;

let model, textureCube;
let model;

const ldrawPath = 'models/ldraw/officialLibrary/';

Expand Down Expand Up @@ -75,7 +75,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputEncoding = THREE.sRGBEncoding;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
container.appendChild( renderer.domElement );

Expand All @@ -85,7 +84,7 @@

scene = new THREE.Scene();
scene.background = new THREE.Color( 0xdeebed );
scene.environment = pmremGenerator.fromScene( new LDrawEnvironment() ).texture;
scene.environment = pmremGenerator.fromScene( new RoomEnvironment() ).texture;

controls = new OrbitControls( camera, renderer.domElement );

Expand All @@ -98,20 +97,20 @@
conditionalLines: true,
smoothNormals: true,
constructionStep: 0,
noConstructionSteps: "No steps."
noConstructionSteps: 'No steps.'
};

window.addEventListener( 'resize', onWindowResize );

progressBarDiv = document.createElement( 'div' );
progressBarDiv.innerText = "Loading...";
progressBarDiv.style.fontSize = "3em";
progressBarDiv.style.color = "#888";
progressBarDiv.style.display = "block";
progressBarDiv.style.position = "absolute";
progressBarDiv.style.top = "50%";
progressBarDiv.style.width = "100%";
progressBarDiv.style.textAlign = "center";
progressBarDiv.innerText = 'Loading...';
progressBarDiv.style.fontSize = '3em';
progressBarDiv.style.color = '#888';
progressBarDiv.style.display = 'block';
progressBarDiv.style.position = 'absolute';
progressBarDiv.style.top = '50%';
progressBarDiv.style.width = '100%';
progressBarDiv.style.textAlign = 'center';


// load materials and then the model
Expand Down Expand Up @@ -291,7 +290,7 @@

function onError() {

const message = "Error loading model";
const message = 'Error loading model';
progressBarDiv.innerText = message;
console.log( message );

Expand Down