urholaukkarinen / transform-gizmo

3d transformation gizmo
https://github.com/urholaukkarinen/transform-gizmo
Apache License 2.0
192 stars 49 forks source link

Gizmo is rendering based on GizmoTarget's Transform not WorldTransform #76

Open ethereumdegen opened 1 week ago

ethereumdegen commented 1 week ago

Gizmo is rendering based on GizmoTarget's Transform not WorldTransform

Therefore, child entities whose parents are not all Origin cannot be translated properly... I tried changing gizmo config resource too to no avail

ethereumdegen commented 1 week ago

To replicate the bug, simply spawn an entity with a nonzero transform, spawn a child under it, and then try to transform the child with the gizmo. The gizmo will be all messed up . ! This is a huge flaw in this crate

Shenmarukai commented 1 week ago

I'm currently running into the same issue as well.

Shenmarukai commented 1 week ago

I made a fork that makes the gizmo transform based on the entities global transform instead of its local transform: https://github.com/Shenmarukai/transform-gizmo-global-transform you can use it by replacing transform-gizmo-bevy = "0.3.0" with transform-gizmo-bevy = { git = "https://github.com/Shenmarukai/transform-gizmo-global-transform" }. Let me know if it works for you. :)

Shenmarukai commented 1 week ago

I made a fork that makes the gizmo transform based on the entities global transform instead of its local transform: https://github.com/Shenmarukai/transform-gizmo-global-transform you can use it by replacing transform-gizmo-bevy = "0.3.0" with transform-gizmo-bevy = { git = "https://github.com/Shenmarukai/transform-gizmo-global-transform" }. Let me know if it works for you. :)

It puts the gizmos in the correct place but its breaking the gizmo control. :( I will see if I can fix that.

ethereumdegen commented 1 week ago

Oh amazing ! Ill take a look and maybe a pr can be submit . Yeah its tricky lol

On Fri, Sep 6, 2024 at 10:37 AM Shane Mulcahy @.***> wrote:

I made a fork that makes the gizmo transform based on the entities global transform instead of its local transform: https://github.com/Shenmarukai/transform-gizmo-global-transform you can use it by replacing transform-gizmo-bevy = "0.3.0" with transform-gizmo-bevy = { git = " https://github.com/Shenmarukai/transform-gizmo-global-transform" }. Let me know if it works for you. :)

It puts the gizmos in the correct place but its breaking the gizmo control. :( I will see if I can fix that.

— Reply to this email directly, view it on GitHub https://github.com/urholaukkarinen/transform-gizmo/issues/76#issuecomment-2334207298, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPVWLY3LRXAC76GKXLHTYLZVG43PAVCNFSM6AAAAABNXQ6SWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUGIYDOMRZHA . You are receiving this because you authored the thread.Message ID: @.***>

Shenmarukai commented 1 week ago

Yeah, I got the control to work now but when the parent is rotated the control of the children starts to get wonky, I need to figure out why its doing that.

It would be nice to eventually have an enum on one of the gizmo configs that would let you switch between using the local and global transforms.

Shenmarukai commented 1 week ago

Turns out its more difficult to fix than I thought but I'm going to keep trying.

Shenmarukai commented 6 days ago

My latest push seems to be working for rotation and translation. Scaling still needs a fix though.