How to remove lines from the CameraHelper

Hi,

I am using the CameraHelpers, and have tried several ways of simplifying them, like this:
camerahelper

Is there a good way to do this?

This does only work with a custom version of THREE.CameraHelper. Check out this updated version:

There is also another way,

you can limit the drawrange.

const helper = new THREE.CameraHelper(light.shadow.camera);
helper.geometry.setDrawRange(0, 38); //excludes the last few lines from being drawn
scene.add(helper);

The gray cross in the CameraHelper just happens to be the last few lines drawn in the geometry when it is updated. Its a bit trickier if you wanted to remove different lines.

To also remove the blue triangle, use

helper.geometry.setDrawRange(0, 32);
2 Likes

Both good solutions, thank you very much :+1: :+1:

Can this also be done with the math plane helper?

It works, but probably not the way you want it to. You may need to consider a custom solution.

Default,
image

helper.geometry.setDrawRange(0, 8);
image

helper.geometry.setDrawRange(0, 1);
image

2 Likes

Cool thanks for sharing.
Yeah I was looking for ‘just’ the outline.
But still, I’ll try those.