-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
obb clipping #882
obb clipping #882
Conversation
enable by using console-log document.querySelector('#clipping-box').setAttribute('obb-collider2', "clipPlaneFunction: obb;") document.querySelector('#clipping-box').play()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the math in this makes my head spin
What's the other branch? |
|
next steps:
|
this barely works: - you need to start a new scene - add google 3d tiles by specifying location - then drag and drop a new street from the add panel - then enter viewer mode
barely working 3 barely-working-clipping3.movissues to fix:
|
ok great progress so far:
things to fix:
Notes for testing / docs outline: Sometimes things just get in the way. Now there's an easy way to Clip It Out! Ingredients:
|
can turn from false to true during session, but then setting from true to false the user must reload to see tiles without clipping. I tried using a reduntant 'enabled' boolean on obb-clipping. that didn't work but i kept it in to test a bit more.
still might be better to have an explicit box some day -- i think there will be many case where a user will wish to have a box like this -- but this might be good enough to ship
Progress notes:
Not working yet:
|
better solution is to monitor for pose changes on target object AND monitor for tiles loaded events from 3dtiles runtime object via threejs-loader-tiles library
Now ready for testing / code review:
|
works!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly just questions that dont need an immediate answer
obb.copy(this.aabb); | ||
obb.applyMatrix4(auxMatrix); | ||
|
||
const clipPlanes = this.createPlanesFromOBB(obb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to update the clipping planes every frame. Can do similar to bounding box recalculation. Consider scenarios when you want to recalculate: rotation, scale, position changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap below lines in an if
statement that checks for the relevant changes that trigger a plane recalculation
const clipPlanes = this.createPlanesFromOBB(obb);
this.applyClippingPlanes(clipPlanes);
barely working v1
enable by pasting into console after loading a scene into editor with google3d tiles layer:
video:
https://github.com/user-attachments/assets/b29a31aa-d312-42b0-b87a-15988f23d775
some things this needs:
trackedObject3D
property to reference the box