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

Fix/z rotation #480

Merged
merged 4 commits into from
Feb 8, 2023
Merged

Fix/z rotation #480

merged 4 commits into from
Feb 8, 2023

Conversation

aranega
Copy link
Member

@aranega aranega commented Jan 30, 2023

Fixes the z rotation in 3D view raised in NetPyNE. The fix takes back some of the modification originally made by @afonsobspinto but that were partially merged at some point.
However, even including portion of code that were present on master, after a rotation on z axis, the 3D representation wasn't refreshed until another rotation/movement was applied as no change in the square distance between the previoulsy computed position of the 3D object and the new one was found. I forced it L478 inTrackballControl.js, but perhaps it's not the best thing to do.

cc: @afonsobspinto , you'll probably be the best person to know as you have way more skill than me related to 3D and three.js 😄

@afonsobspinto afonsobspinto linked an issue Jan 30, 2023 that may be closed by this pull request
Copy link
Member

@afonsobspinto afonsobspinto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this with the geppetto-showcase examples and everything seems to works fine (apart from an unrelated issue).
I haven't seen any code changes that shocked me. It's a bit strange that you had to add something (L478) besides what was already on the previous working version but it is indeed necessary so I'm ok with that.

Apart from the issue, I think the custom changes we have on the Trackball Controls are very hard to maintain and I think we should put some effort in documenting/understanding why some of the custom MetaCell changes are there. I would prefer to have all the controls logic coming directly from ThreeJS if possible

@enicolasgomez enicolasgomez merged commit 33b748c into development Feb 8, 2023
@afonsobspinto
Copy link
Member

One of the reasons for having our custom trackaball controls is because threejs trackball controls work only on 2 dimensions (targetting mouse movements) while in our case we are interested in having an api that allows 3D movements at once (so that buttons like rotate z and rotate mz from the canvas toolbar can exist). Thanks @aranega for the explanation

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.

Fix rotate z and rotate mz camera controls
3 participants