Objects cutting off when at certain angle/distance

Hi all - Some objects start to cut off when I move back a certain distance and view at a certain angle and I can’t figure out why.

The areas circle are where the trees should be really tall, but keeps getting cut off when I move back. Normally all there when closer to them. Thanks!

Hi dabearcat,

It seems that the issue you’re facing with objects cutting off could be related to the camera’s near and far clipping planes, or possibly the camera’s frustum configuration.

Here’s a checklist to consider:

  1. Near and Far Clipping Planes: Ensure that the nearClipPlane is set appropriately. If it’s too far, objects within that distance won’t be rendered. You can adjust it in your camera component.

    get nearClipPlane(): number { return this._nearClipPlane; }
    @serializable()
    set nearClipPlane(val) {
        const changed = this._nearClipPlane != val;
        this._nearClipPlane = val;
        if (this._cam && (changed || this._cam.near != val)) {
            this._cam.near = this._nearClipPlane;
            this._cam.updateProjectionMatrix();
        }
    }
    
  2. Camera Frustum: Check if the frustum is being updated correctly. If not, it might not be considering the appended objects at larger distances.

    public updateFrustum() {
        if (!this._frustum) this._frustum = new Frustum();
        this._frustum.setFromProjectionMatrix(this.getProjectionScreenMatrix(this._projScreenMatrix, true), this.context.renderer.coordinateSystem);
    }
    
  3. Rendering Options: Ensure that objects have the correct rendering layers set. If they’re on an inappropriate layer, they may not be rendered.

  4. Level of Detail (LOD): If you’re using LOD for your trees, make sure that the distance key settings are configured properly to determine when to show or hide them based on camera distance.

  5. Raycasting or Visibility Checks: If you’re using raycasting for visibility checks or other filtering processes, ensure that they are not inadvertently skipping those objects.

If you need assistance adjusting your project settings or code, please provide more details, including snippets of the relevant camera or object settings. This will help troubleshoot the issue more accurately.

You can reference more details in the documentation for the camera and rendering (see the documentation) (see the documentation).

Let me know how I can assist you further!

3 replies left
thread_0rWeFvxcADTGqQIjEPF3qv7w
Reply to this message to continue the conversation

Hi, if you’re using Unity then make sure to setup your near and far clipping planes to sensible values (according to how large your scene is)

Does your scene use OrbitControls? It might also help to disable autoFitting