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

viewer.scene.globe.pick do not pick Cesium3DTileset's tile #6806

Closed
dminor112 opened this issue Jul 17, 2018 · 5 comments
Closed

viewer.scene.globe.pick do not pick Cesium3DTileset's tile #6806

dminor112 opened this issue Jul 17, 2018 · 5 comments

Comments

@dminor112
Copy link

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction((movement) => {
// var pickedPrimitive = viewer.scene.pick(movement.position);
var ray = viewer.scene.camera.getPickRay(movement.position);
var cartesian = viewer.scene.globe.pick(ray, viewer.scene);

if (cartesian) {
viewer.entities.add({
id: nombre.toFixed(2),
position: cartesian,
point : {
pixelSize : 10,
color : Cesium.Color.YELLOW
}
});
} else {
alert('Globe was not picked');
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

image

I want to use the code to get the intersection of a ray and a Cesium3DTileset. But get the intersection of the ray and the background tarrein. How can i get what i want?

@hpinkos
Copy link
Contributor

hpinkos commented Jul 17, 2018

Hi @dminor112, this isn't working because viewer.scene.globe.pick only picks terrain tiles. Instead, you can use scene.pickPosition to get the clicked position on the 3d tileset.

In the future, please ask questions like this on the forum: https://groups.google.com/forum/?hl=en#!forum/cesium-dev
We use GitHub exclusively for tracking bugs and planning new features. Thanks!

@hpinkos hpinkos closed this as completed Jul 17, 2018
@dminor112
Copy link
Author

Sorry, I was wondering if this is bug.
I need to use a ray to test intersetion, because pickPosition only support windowPosition.And sometimes the ray do not set from window. How can i compute the intersection points of a ray with 3d tileset?

@lilleyse
Copy link
Contributor

@dminor112 we are currently working on that exact feature. Stay tuned!

#6080 will add support for picking from a ray.

@dminor112
Copy link
Author

Which release will support this feature? We are very looking forward to it. Thank you.

@lilleyse
Copy link
Contributor

It's probably too soon for 1.48, but I would guess around 1.49.

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

3 participants