I want to load the ninja OBJ file from threejs/examples/models/obj/ninja but it doesn’t seem to be working, see my code here: Glitch :・゚✧ any help would be appreciated
Unfortunately, this particular model is not properly centered. Try to translate the model in the onLoad()
callback and move the camera a bit away from the plane. Use the following to move the model into your viewing area.
root.position.y -= 160;
Have you tried to adapt the code from the example? Remember, it’s open-source .
I’ve managed to get it working but can’t figure out how to add a background, see code here: Glitch :・゚✧
this is the background I want to add, it’s called ‘venice sunset’:
I think you should find a solution for this issue in your other topic: Damaged Battle Helmet
I’ve already tried replacing the scene.background with an envmap but it doesn’t work
{
const loader = new THREE.TextureLoader();
const texture = loader.load(
'https://cdn.glitch.com/0f2dd307-0d28-4fe9-9ef9-db84277033dd%2Fvenice_sunset.jpg?v=1620758317378',
() => {
const rt = new THREE.WebGLCubeRenderTarget(texture.image.height);
rt.fromEquirectangularTexture(renderer, texture);
scene.background = rt.texture;
scene.environment = rt.texture
});
}