cte677
1
Code:
const carUrl = new URL('../assets/car.glb', import.meta.url);
and
assetLoader.load(carUrl.href, function(gltf) {
const model = gltf.scene;
scene.add(model);
model.position.set(0, 0, 0);
}, undefined, function(error) {
console.error(error);
});
How do increase the size and change the color of car.glb?
cte677
3
The answer for size, add
model.scale.set(10, 10, 10);
For color, it depends on the program that created the glb file. I downloaded a car from Sketchfab — Downloadable Cars - A 3D model collection by Jamie Rose (@jamien64) - Sketchfab —.
This car does show up in color!
1 Like
cte677
4
I was missing overhead light. I added directional light.
const directionaLightLeft = new THREE.DirectionalLight(0xFFFFFF, 100);
scene.add(directionaLightLeft);
directionaLightLeft.position.set(-30, 30, -10);
const directionaLightRight = new THREE.DirectionalLight(0xFFFFFF, 100);
scene.add(directionaLightRight);
directionaLightRight.position.set(30, 30, 10);
now I see color! The lights are like spot lights.
I currently have ambient light:
const ambientLight = new THREE.AmbientLight(0xFFFFFF);
scene.add(ambientLight);
How do I illuminate the entire area, without using multiple spotlights?