You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use three to create a costumed character, and I need to see the character's face, but when I zoom in on the character, the character's face disappears. I guess it's a problem with the near and far settings of the camera. I modified the near and far parameters of the camera but the character's face cannot be displayed, and the screen even goes black. In Unity or Maya, whenever this kind of problem occurs, setting the near and far parameters of the camera can solve it. However, in threejs, it does not solve my problem. I think this is a bug.
Reproduction steps
1.When I use the mouse wheel to zoom out, the character's face is displayed.
2.When I use the mouse wheel to zoom in, the character's face is not displayed.
Code
const scene = new THREE.Scene();
const defaultMap = {
x: 20,
y: 20,
z: 20,
}
let whRate=window.innerWidth/window.innerHeight;
const camera = new THREE.PerspectiveCamera(70, whRate, 1, 1000);
camera.position.set( 0, 10, 20 );
var lights = [];
lights[0] = new THREE.PointLight(0xffffff,1.5, 50, 0);
lights[0].position.set(0, 180, -200);
scene.add(lights[0]);
Description
I want to use three to create a costumed character, and I need to see the character's face, but when I zoom in on the character, the character's face disappears. I guess it's a problem with the near and far settings of the camera. I modified the near and far parameters of the camera but the character's face cannot be displayed, and the screen even goes black. In Unity or Maya, whenever this kind of problem occurs, setting the near and far parameters of the camera can solve it. However, in threejs, it does not solve my problem. I think this is a bug.
Reproduction steps
1.When I use the mouse wheel to zoom out, the character's face is displayed.
2.When I use the mouse wheel to zoom in, the character's face is not displayed.
Code
const scene = new THREE.Scene();
const defaultMap = {
x: 20,
y: 20,
z: 20,
}
let whRate=window.innerWidth/window.innerHeight;
const camera = new THREE.PerspectiveCamera(70, whRate, 1, 1000);
camera.position.set( 0, 10, 20 );
var lights = [];
lights[0] = new THREE.PointLight(0xffffff,1.5, 50, 0);
lights[0].position.set(0, 180, -200);
scene.add(lights[0]);
loader.load('/src/models/dHuman_g.glb', function(obj){
let mesh = obj.scene.children[0];
mesh.material=new THREE.MeshBasicMaterial( { color: 0x00ff00 ,side:THREE.DoubleSide} );
mesh.position.set(0, -20, 0);
mesh.scale.set(1, 1, 1);
mesh.scale.setScalar(10);
scene.add(mesh);
})
const render = () => {
renderer.render(scene, camera);
requestAnimationFrame(render);
}
render();
Live example
I think the above description makes it clear what the problem is.
Screenshots
No response
Version
node v20.8.0;npm v10.1.0;
Device
No response
Browser
Firefox
OS
Windows
The text was updated successfully, but these errors were encountered: