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

Mouse picking #23

Open
kvark opened this issue Jun 8, 2017 · 5 comments · May be fixed by #43
Open

Mouse picking #23

kvark opened this issue Jun 8, 2017 · 5 comments · May be fixed by #43
Assignees
Labels

Comments

@kvark
Copy link
Collaborator

kvark commented Jun 8, 2017

Three.js employs a generic raycasting model for picking:
https://threejs.org/docs/#api/core/Raycaster

We could make it work with roughly the following API:

let raycaster = three::RayCaster::from_camera(mouse_coords, &cam);
for (name, world_transform, material) in raycaster.cast(&scene) {
  // do something
}

Clearly, we'd want the nodes to be named for this to be convenient.

@kvark kvark added the feature label Jun 8, 2017
@vitvakatu
Copy link
Member

vitvakatu commented Jun 15, 2017

Maybe it's better to return NodeInfo rather than (name, world_transform, material)?

@kvark kvark self-assigned this Jun 20, 2017
@kvark kvark linked a pull request Jun 25, 2017 that will close this issue
@alteous
Copy link
Member

alteous commented Aug 16, 2017

How would you feel about Mesh holding onto an Arc<Geometry>? This would be useful for mouse picking against geometry.

@alteous
Copy link
Member

alteous commented Aug 16, 2017

It might be overkill to be mouse picking on individual triangles. Perhaps we could have a Collider abstraction?

@alteous
Copy link
Member

alteous commented Aug 16, 2017

Maybe it's better to return NodeInfo rather than (name, world_transform, material)?

Also, how about returning some unique integer ID instead of a name?

@vitvakatu
Copy link
Member

I would like to return smth like NodeInfo. I'm not sure user needs access to triangles, by the way.
name seems useless for me, I'd like to see node pointer instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants