question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Frustum: request add function

See original GitHub issue

Request add Frustum function named containsSphere.code like this

function (sphere) {

        var planes = this.planes;

        for (var i = 0; i < 6; i++) {

            if (planes[i].distanceToPoint(sphere.center) < sphere.radius) {

                return false;

            }

        }

        return true;

    }

It will be useful to judge whether or not to see a whole object.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
gkjohnsoncommented, Mar 31, 2020

Not sure why you use an instance of Frustum 🤔.

I agree that everything that’s needed is available but just for some more context OP is probably trying to calculate what is in view of a camera by the hierarchical bounds to the camera frustum – basically doing manual frustum culling so you know which objects need to be processed further for that frame. The existing Frustum.intersectsSphere should be enough here, though.

It could be a way to instead of calculating geometric errors in 3dtils

Shameless plug but OP if you’re interested I am also working on a 3d tiles implementation for three.js that you can check out here if you’re interested:

https://github.com/NASA-AMMOS/3DTilesRendererJS

2reactions
Mugen87commented, Mar 31, 2020

In order to determine if an object’s bounding volume is inside a specific cell of a Octree or other spatial structures like BVH, I would use Box3.intersectsSphere() or Box3.containsBox() (just derive the AABB from your sphere). Not sure why you use an instance of Frustum 🤔.

It seems the existing interface is sufficient for your use case. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

three.Frustum JavaScript and Node.js code examples - Tabnine
Simplified HTTP request client. cheerio. Tiny, fast, and elegant implementation of core jQuery designed specifically for the server. qs. A querystring parser ...
Read more >
Add p5.Camera.frustum documentation on reference page
To: Sets thing. Accepts the same parameters as the global thing. More information on this function can be found there. For example, the ......
Read more >
vtkExtractSelectedFrustum Class Reference - VTK
VTK: vtkExtractSelectedFrustum Class Reference. Returns the portion of the input dataset that lies within a selection frustum. More...
Read more >
[Feature Request] visibility results access, frustum check
I cant find a way to ask UE4 if a actor/component was rendered last frame, aka was/is visible for a specific camera.
Read more >
Surface areas of revolution - Ximera - The Ohio State University
We compute surface area of a frustrum then use the method of “Slice, Approximate, Integrate” to find areas of surface areas of revolution....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found