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

Picking image plane returns incorrect world position #845

Open
OmarHussein1 opened this issue Apr 8, 2022 · 0 comments
Open

Picking image plane returns incorrect world position #845

OmarHussein1 opened this issue Apr 8, 2022 · 0 comments

Comments

@OmarHussein1
Copy link

Describe the bug
I am trying to pick a point on an embedded image plane that is based on the example at https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/scene/ImagePlane/ImagePlane.js~ImagePlane.html

The resulting world position of the pick result is always on the plane [x, 0, z].

To Reproduce
Setup the viewer as Example 2: Embed an image in a cross-section plane.
Store the ImagePlane:
this.imagePlane = new ImagePlane(self.viewer.scene, { image: image, visible: true, gridVisible: true, size: 23.95, position: sectionPlane.pos, dir: [0, -1, 0], collidable: false, opacity: 0.75, clippable: false, pickable: true }

Pick using the following parameters:
const hit = this.viewer.scene.pick({ canvasPos: canvasPos, pickSurface: true, pickSurfacePrecision: true });
Check that you are actually picking the plane and not the model itself:
hit.entity.id === this.imagePlane._plane.id

Extra Clarification
In my environment I have the image plane position at
{
"0": 10.975000649690628,
"1": 5.828244369477034,
"2": -11.232501029968262
}

When I get the pick result, confirm that the entity of the pick is the same as the underlying plane geometry of the Image plane. Then I get the resulting pick worldPos as:

[
1.8699579425156434,
1.601874828338623e-7,
-19.111678961591466
]

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

1 participant