CameraHelper not linked?

Typing :

camera = new THREE.PerspectiveCamera(30, container.offsetWidth / container.offsetHeight, 0.1, 5);
camera.position.set(0.5, 0.2, 0.5);
var helper = new THREE.CameraHelper( camera);
scene.add( helper );

… whatever the position the camera I set, CameraHelper doesn’t move. Is there any trick missing here?

Thank you guys.

Please have a look at: https://threejs.org/examples/#webgl_camera

Do you update your helper in the animation loop?

1 Like

Michael, in this example they attach the camera and the helper to e Group.
Seems to work now - don’t know what happened. I’ll reopen this post in case of!

The premise of using ‘CameraHelper’ is to use at least two cameras, so that ‘CameraHelper’ will appear completely on the screen.

‘CameraHelper’使用有意义的前提是至少使用两个相机,这样‘CameraHelper’才会完整的出现在屏幕内.

So strange API:

// addition
cameraRig = new THREE.Group();
cameraRig.add( camera2 );
scene.add( cameraRig );

What if we add this in source code? Seems that adding two Groups not changing anything and saving backward compatibility.