I'm currently working on enhancing the visual quality of my 3D models, aiming for smoother edges and more realistic shadows. To achieve this, I am experimenting with an OBJ file format. Here's the code snippet I'm using to load and display the file:
function LoadOBJMTL(file) {
var objObject = new THREE.Object3D;
var loader = new THREE.OBJMTLLoader();
var objfile = file + ".obj";
var mtlfile = file + ".mtl";
loader.load(objfile, mtlfile, function(object) {
objObject = object;
scene.add(objObject);
});
}
Nothing particularly unique there...
In terms of illuminating the scene, I have implemented 5 directional lights as shown below:
addDirectionLight([-1, 0, 0], 1);
addDirectionLight([1, 0, 0], 1);
addDirectionLight([0, 0, -1], 1);
addDirectionLight([0, 0, 1], 1);
addDirectionLight([0, 1, 0], 1);
function addDirectionLight(direction, intensity) {
var directionalLight = new THREE.DirectionalLight(0xffffff, intensity);
directionalLight.position.set(direction[0], direction[1], direction[2]);
scene.add(directionalLight);
}
Here are the current results of these efforts:
For comparison purposes, I have also uploaded the same model to verold and sketchfab
While I'm satisfied with how the model appears in both verold and sketchfab, I would appreciate any suggestions on techniques to further enhance the visual appeal of my threejs model. My goal is to achieve cleaner lines and improved lighting effects.
Thank you for your assistance!