Currently, I am using the STLLoader plugin from the Github repository of three.js.
This is a snippet of my code:
this.loadSTL = function(scene, stlFile){
var loader = new THREE.STLLoader();
loader.addEventListener('load', function(geometry, materials){
var geometry = geometry.content;
var material = new THREE.MeshPhongMaterial({ambient: 0xff5533, color: 0xff5533, specular: 0x111111, shininess: 200});
var mesh = new THREE.Mesh(geometry, material);
mesh.position.set(0, -0.9, 0);
mesh.rotation.set(0, 0, 0);
mesh.scale.set( 0.012, 0.012, 0.012);
scene.add(mesh);
});
loader.load(stlFile);
}
The issue at hand is that the object loaded from the STL file tends to change in height when the window resolution changes. Is there a specific setting we should be configuring to maintain a consistent width/height for the mesh regardless of the screen or window resolution?