Skip to content
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

FIX: Synch MarqueePicker frustum far plane to camera projection's far plane #1315

Open
julio-cavallari opened this issue Dec 26, 2023 · 2 comments
Milestone

Comments

@julio-cavallari
Copy link

Describe the bug
Using our own model, selection by marquee picker does not work correctly, with the camera far away nothing is ever selected, and with the camera close to an object, the selected objects are not those within the selection area

To Reproduce
Steps to reproduce the behavior:

  1. Reproduce the example to configure marquee picker
  2. Use the xkt model contained in this link
  3. Use both inside and intersect selection
  4. See the objetcs are not selected

Expected behavior
Select objects correctly based on selection area

Screenshots
Video with the problem

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 120.0.6099.109

Additional context
Add any other context about the problem here.

@xeolabs
Copy link
Member

xeolabs commented Dec 27, 2023

Probably fixable by extending Marqueepicker._buildMarqueeFrustum to set the picking frustum's far plane distance to the same distance as the Camera's active projection:

https://github.com/xeokit/xeokit-sdk/blob/master/src/extras/MarqueePicker/MarqueePicker.js#L306

eg.

       math.frustumMat4(
            left,
            right,
            bottom * ratio,
            top * ratio,
            near,
            far: this.scene.camera.projection.far,
            this._marqueeFrustumProjMat,
        );

Where the far plane is provided by these projection components:

https://github.com/xeokit/xeokit-sdk/blob/master/src/extras/MarqueePicker/MarqueePicker.js#L306
https://github.com/xeokit/xeokit-sdk/blob/master/src/extras/MarqueePicker/MarqueePicker.js#L306

@xeolabs xeolabs changed the title MarqueePicker don't work well FIX: Synch MarqueePicker frustum far plane to camera projection's far plane Dec 27, 2023
@xeolabs xeolabs added this to the 2.5.1 milestone Dec 27, 2023
@julio-cavallari
Copy link
Author

I noticed that the problem is related to the canvas size, when the canvas is the full size of the screen, the selection works perfectly

@xeolabs xeolabs modified the milestones: 2.5.2, 2.2.5 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants