GeezerVison is showing github.com — Rotation by BalzaniEdoardo · Pull Request #439 · fastplotlib/fastplotlib
Conversation
Added a rotation property and a setter to Graphic and a method to set a rotation of a given angle over one of the axis, with respect to the world.
closes #427
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
EricThomson reacted with hooray emoji
EricThomson reacted with rocket emoji
All reactions
-
🎉
1 reaction
-
🚀
1 reaction
|
good to go after a test :D
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
good to go after a test :D
Nice!!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
A general remark about transformations for the graphics object:
I think world_object.local makes more sense that .world. In that case it represents the rotation with respect to the parent. When the graphics are flat, its the same thing (possibly more efficient). And when there is a scene graph (graphics being children of other graphics) in the majority of cases you want to transform with respect to the parent.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks! If all WorldObjects in a subplot exist within the same scene, then .local and .world have the same effect right? Is there a scientific visualization usecase where you might want to differentially use .local and .world?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
almarklein
commented
Mar 22, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
If all WorldObjects in a subplot exist within the same scene, then .local and .world have the same effect right?
Yes.
Is there a scientific visualization usecase where you might want to differentially use .local and .world?
The classic example is rendering a robot arm, consisting of several segments, each a child of the previous. If you rotate an element, all the child elements rotate along.
In this scenario, using .local specifies the rotation with respect to the parent, while using .world applies a rotation relative to the word. The first is more common. Many scenegraphs don't even support the latter. But .world can also be convenient, also e.g. to set rotations with .local and then checking positions/rotations in .world.
So practically: I'd recommend using .local everywhere now. And maybe at a later time, if/when fpl supports child graphics, add support for .world transforms.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
clewis7
Awaiting requested review from clewis7
clewis7 is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
method for rotating graphics
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|