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

Implement highlight on hover using a Color Picking technique #8

Merged
merged 3 commits into from
Oct 5, 2022

Conversation

martinRenou
Copy link
Collaborator

For now this is only a visual effect, the state is not synced between clients. We can discuss in an issue whether this could be useful or not.

color_picking.mp4

@trungleduc
Copy link
Member

Thanks @martinRenou, It looks great!
For sharing state with other users, I don't think it is useful but is it possible to highlight an object when we select it from the control panel?

@martinRenou
Copy link
Collaborator Author

martinRenou commented Oct 5, 2022

So actually, maybe instead of an "highlight on hover" behavior, it would make sense to implement a click selection, and when you click on the piece it selects it in the control panel?

That way we can both select from the control panel and select from the 3D view.

@trungleduc
Copy link
Member

Freecad has both hover and selection events, but I think the selection is more useful.

fc

That way we can both select from the control panel and select from the 3D view.

That's great!

@martinRenou martinRenou marked this pull request as draft October 5, 2022 09:31
@martinRenou
Copy link
Collaborator Author

Let's do just like FreeCad! The color-picking being super cheap, I think we can afford it.

@martinRenou
Copy link
Collaborator Author

I implemented both an hover logic and a click logic for selection:

click_hover.mp4

We can bind the control panel UI to the actual 3D selection in a separate PR

@martinRenou martinRenou marked this pull request as ready for review October 5, 2022 11:48
src/mainview.tsx Show resolved Hide resolved
src/mainview.tsx Show resolved Hide resolved
src/mainview.tsx Show resolved Hide resolved
src/mainview.tsx Show resolved Hide resolved
@trungleduc
Copy link
Member

Thanks!

@trungleduc trungleduc merged commit 7f8d0c6 into jupytercad:main Oct 5, 2022
@martinRenou martinRenou deleted the color_picking branch October 6, 2022 07:22
martinRenou added a commit to martinRenou/jupytercad that referenced this pull request Dec 6, 2022
…cad#8)

* Implement highlight on hover using a Color Picking technique

* Implement both selection and hover

* No need to compute pointer position on click
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

Successfully merging this pull request may close these issues.

None yet

2 participants