Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

threejs-model-loader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

threejs-model-loader - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

1

example/index.js

@@ -198,2 +198,3 @@ // Converts a datatransfer structer into an object with all paths and files

// check if the end of file and url are the same
// TODO: This does not account for `up directory` `../` tokens
const len = Math.min( name.length, url.length );

@@ -200,0 +201,0 @@ return url.substr( url.length - len ) === name.substr( name.length - len );

22

model-viewer-element.js

@@ -108,2 +108,3 @@ // model-viewer element

scene.add( dirLight );
scene.add( dirLight.target );

@@ -185,2 +186,3 @@ // Containers setup

const bbox = new THREE.Box3().setFromObject( this._model );
const center = bbox.getCenter( new THREE.Vector3() );
const sphere = bbox.getBoundingSphere( new THREE.Sphere() );

@@ -191,8 +193,10 @@ const minmax = sphere.radius;

cam.right = cam.top = minmax;
// Update the camera to focus on the center of the model so the
// shadow can encapsulate it
const dirLight = this.directionalLight;
const offset = dirLight.position.clone().sub( dirLight.target.position );
dirLight.target.position.copy( center );
dirLight.position.copy( center ).add( offset );
cam.updateProjectionMatrix();
// TODO: Position the camera about the center of the model
// because it's possible that the model will be off center
// and extend outside of the shadow camera bounds
}

@@ -424,4 +428,10 @@

// Can't use the `copy` function because the phong material expects
// a specular color
// https://github.com/mrdoob/three.js/issues/14401
const mat = new THREE.MeshPhongMaterial();
mat.copy( m );
Object.keys( m )
.filter( key => key in mat && m[ key ] && key != 'type' )
.forEach( key => mat[ key ] = m[ key ] );
mats[ i ] = mat;

@@ -428,0 +438,0 @@ m = mat;

{
"name": "threejs-model-loader",
"version": "0.0.4",
"version": "0.0.5",
"description": "THREE.js Model Loader that delegates to the appropriate geometry loader",

@@ -5,0 +5,0 @@ "main": "ModelLoader.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc