Coder Social home page Coder Social logo

Comments (3)

Mugen87 avatar Mugen87 commented on June 1, 2024 1

The idea is to have bounding volumes on geometry level since that's where data which define the bounding box in local space. Logic like ray casting or culling makes sure the bounding volumes get properly transformed into other spaces for intersection tests if required.

There are two exceptions regarding this policy: Certain types of 3D objects like SkinnedMesh have bounding volumes on object level since the geometry data alone are not sufficient to compute correct bounding volumes.

from three.js.

tripdragon avatar tripdragon commented on June 1, 2024

I get that, however its counter to the available workflow game engines provide. In other engines you can add a bounds or volume component to the root and tweak as needed. And since three has the Box3.setfromObject, it seems it would be an obvious next step.

In your explainer the only time its optimized is if you add a cube geometry in the case of multiple meshes, and then setup management logic to resize as needed.

from three.js.

tripdragon avatar tripdragon commented on June 1, 2024

I read your reason again and you note SkinnedMesh as having this concept directly already. Would you not argue then the same reasoning is true that a multi meshed imported model does not have sufficient singular geometry of reference to build an adequate bounding volume so a full encompassing bounding box at object level would be a proper location?

One could go further and say imported models should have a subclass of Group() and handle some data caching and special functions.

Looking though the code at

this._computeIntersections( raycaster, intersects, _ray );

Swapping out the digging through mesh function routine would be a proper place for it, and since all other classes rewrite their own raycast to handle current singular geometry bounds, then nothing should really suffer.

from three.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.