Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Threejs Object local clipping #2326

Answered by nzjony
paulsoning asked this question in Q&A
Oct 22, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

hi @paulsoning , we render objects relative to the camera, see:

object.position.sub(cameraPosition);

As such, you need to transform the plane based on the position of the object, see: https://stackoverflow.com/questions/45611247/local-clipping-of-planes-based-on-local-axis

Something like:

        const updateListener = () => {
            // update position of plane based on the object's position
        };
        mapView.addEventListener(MapViewEventNames.Render, updateListener);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@paulsoning
Comment options

@nzjony
Comment options

Answer selected by paulsoning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants