-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Raycast #550
Comments
It seems to be caused by async computed property, because it works correctly when I define a But I haven't got solutions yet... |
|
mouseDownHandler(event) {
this.isMouseDown = true;
this.mouseOrigin = new Vector2(event.offsetX, event.offsetY);
this.raycaster.setFromCamera(
new Vector2(
(event.clientX / window.innerWidth) * 2 - 1,
-(event.clientY / window.innerHeight) * 2 + 1,
),
this.$refs.camera.inst,
);
const [intersect] = this.raycaster.intersectObjects(this.$refs.scene.inst.children, true);
if (intersect) {
// do something
}
} |
Setting recursivity is actually wrong : all i want is the nearest face from the model. I've also added an arrow helper to show the ray, and surprisingly, it always origins from (0,0,0) not the mouse normalized coordinates (or this.raycaster.ray.origin). EDIT: nevermind, it is just the vgl-arrow-helper is missing the origin prop. @h-ikeda i suspect same as well, since everything seems correct on the Ray side, but i don't see how to solve... |
Hello awesome Vue-GL :)
I am trying to play with interactivity, using Three.Raycaster.
So i've settled a classic Scene with a loaded Mesh(BufferGeometry) and a plane for the ground.
Next, i implemented this method :
... my tests shows the ray "finds" the plane, but never the model ... despite the console logging an apparently tangible Mesh.
I'm really clueless there why it does not find the model ?
How do you handle raycasting ?
EDIT: Reproduced the issue in this repo.
This line describes the issue : commented line is the "real" model (asyncloaded BufferGeometry) i want to intersect, while the "working" uncommented line is just the ground (PlaneBufferGeometry)
The text was updated successfully, but these errors were encountered: