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

3D Affine transforms should be represented correctly by three arrows #2503

Closed
nikolausWest opened this issue Jun 22, 2023 · 1 comment · Fixed by #2577
Closed

3D Affine transforms should be represented correctly by three arrows #2503

nikolausWest opened this issue Jun 22, 2023 · 1 comment · Fixed by #2577
Assignees
Labels
enhancement New feature or request 📺 re_viewer affects re_viewer itself user-request This is a pressing issue for one of our users

Comments

@nikolausWest
Copy link
Member

Follow on to #753.

Since we now support full 3D affine transforms, and these transforms should be represented in 3D by a set of three colored arrows, the arrows should represent not just the rigid transform but also shearing and scaling. For instance:

  • If the transform involves scaling in the x-axis by a factor of 2, the red arrow should be two times longer than the other two.
  • If the transform isn't orthogonal, the arrows shouldn't be orthogonal either.
  • If one transform scales points uniformly by a factor of 2, and another transform is a pure rotation, the three arrows of the first should be two times as long as the three arrows of the second.
    • Corollary: Any configurable sizing of the transforms should be set globally for the whole view.
    • It may be difficult to have these make sense to express in screen space sizes.
@nikolausWest nikolausWest added enhancement New feature or request 📺 re_viewer affects re_viewer itself labels Jun 22, 2023
@emilk
Copy link
Member

emilk commented Jun 27, 2023

@Wumpf Wumpf added the user-request This is a pressing issue for one of our users label Jun 27, 2023
@Wumpf Wumpf self-assigned this Jun 30, 2023
Wumpf added a commit that referenced this issue Jul 17, 2023
…2577)

### What

Fixes #753. Fixes #2503. Fixes #2269
* #753 
* #2503
* #2269

Adds a new scene part to visualize all transform arrows - decided to
avoid the term "gizmo" since gizmos as they are used for manipulating an
object (e.g. Blender, Unity3D, Unreal etc.) do have quite different
properties in what they need to show and are typically *not* used to
visualize the actual transform.

Introduces two new properties that (like all other object properties)
will need to be componetized and be part of the blueprint apis:
* transform visibility: On by default iff the entity or any of its
children has a pinhole transform or if the entity doesn't have any other
components than `Transform3D`
* transform arrow length: By default a heuristic world bounding box
based scale, can be chosen freely per object.

Polished the api_demo#transform_test a little bit to be able to use it
as a test case for this:

![image](https://github.com/rerun-io/rerun/assets/1220815/538a8cee-36f9-4af0-a5a6-51723f6e925f)

Note in particular that skew & scale works as expected:

![image](https://github.com/rerun-io/rerun/assets/1220815/4482d9b8-6e12-405a-9431-bf18ac7d413f)

(this shows two transforms on the same spot, one rotated along x, one
scaled along x)

![image](https://github.com/rerun-io/rerun/assets/1220815/b18d18c0-4ba6-4e84-a1e0-f125320655e8)


Pinhole cameras no longer are hacked to have their private gizmo -
clicking it clicks the entity with the transform now, now the pinhole
camera (this _may_ be the same, see #2568):

![image](https://github.com/rerun-io/rerun/assets/1220815/ce04c4a4-0d77-4a91-abbc-1331b3b5f36e)



### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2577) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2577)
- [Docs
preview](https://rerun.io/preview/pr%3Aandreas%2Ftransform-gizmos/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Aandreas%2Ftransform-gizmos/examples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 📺 re_viewer affects re_viewer itself user-request This is a pressing issue for one of our users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants