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

Support affine transformations (allow scaling!) #1956

Closed
Wumpf opened this issue Apr 22, 2023 · 4 comments · Fixed by #2102
Closed

Support affine transformations (allow scaling!) #1956

Wumpf opened this issue Apr 22, 2023 · 4 comments · Fixed by #2102
Assignees
Labels
enhancement New feature or request 🐍 Python API Python logging API 🦀 Rust API Rust logging API

Comments

@Wumpf
Copy link
Member

Wumpf commented Apr 22, 2023

Right now we expose only pinhole transforms and rigid transforms (== rotation+ translation).
Since our transform hierarchy internally deals with affine transformations it should be relatively easy to add those.

Caveat here is ofc that there are various ways of representing them. Straight forward and most flexible (too flexible?) is a 3x3 matrix + translation (this is what glam does), but users may want to specify rotation+translation+scale (careful: Need to define the order of these operations!). Making this ticket related to #1882

@Wumpf Wumpf added enhancement New feature or request 🐍 Python API Python logging API 🦀 Rust API Rust logging API labels Apr 22, 2023
@Wumpf
Copy link
Member Author

Wumpf commented Apr 22, 2023

should probably also add Mat4 support as well while on it (trickier because need to define what's supported)

@emilk
Copy link
Member

emilk commented Apr 26, 2023

Affine transforms include rotation, translation, non-uniform scaling, and shearing.

This is best represented with a 4x3 matrix, which is effectively what glam does (https://docs.rs/glam/latest/glam/f32/struct.Affine3A.html - I think @Wumpf meant to write "3x3 + translation" not "3x3 + quaternion").

Our API should be able to specify such a 4x3 matrix directly, or as translationrotationscale.

Adding a fourth row (4x4 matrix) adds support for full projection matrices, but this needs careful consideration, so let's leave that for later.

@Wumpf
Copy link
Member Author

Wumpf commented Apr 26, 2023

meant to write "3x3 + translation" not "3x3 + quaternion").

yes :)
And agreed with assessment on 4x3 & 4x4!

@emilk
Copy link
Member

emilk commented May 2, 2023

We should probably ignore the scaling for point radius when that radius is in UI points

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🐍 Python API Python logging API 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants