GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rotation by BalzaniEdoardo · Pull Request #439 · fastplotlib/fastplotlib

Conversation

@BalzaniEdoardo

@BalzaniEdoardo BalzaniEdoardo commented Mar 19, 2024

Copy link
Copy Markdown
Collaborator

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
BalzaniEdoardo added 4 commits March 19, 2024 15:50
@BalzaniEdoardo
added rotation property
23cbf62
@BalzaniEdoardo
added a rotate method to rotate along axis
1f310a6
@BalzaniEdoardo
fixed axis
22cfa4f
@BalzaniEdoardo
added docstrings
3c41a09
@kushalkolar

kushalkolar commented Mar 19, 2024

Copy link
Copy Markdown
Member

good to go after a test :D

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BalzaniEdoardo

BalzaniEdoardo commented Mar 19, 2024

Copy link
Copy Markdown
Collaborator Author

good to go after a test :D

Nice!!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 20, 2024

Copy link
Copy Markdown
Member

Some notes on testing here: https://github.com/fastplotlib/fastplotlib/blob/main/CONTRIBUTING.md#running-tests

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Mar 20, 2024

Copy link
Copy Markdown
Collaborator

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 22, 2024

Copy link
Copy Markdown
Member

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Mar 22, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BalzaniEdoardo
rotate in local coord
77bdb41
@BalzaniEdoardo
BalzaniEdoardo requested a review from clewis7 as a code owner March 27, 2024 22:48
kushalkolar
kushalkolar requested changes Mar 27, 2024
View reviewed changes
Comment thread fastplotlib/graphics/_base.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@BalzaniEdoardo
fix typo
5f60395
kushalkolar
kushalkolar previously approved these changes Mar 27, 2024
View reviewed changes
BalzaniEdoardo added 2 commits March 27, 2024 18:59
@BalzaniEdoardo
Merge branch 'main' into rotation
9feabbc
@BalzaniEdoardo
black-ed
7662e2b
@BalzaniEdoardo
BalzaniEdoardo dismissed kushalkolar’s stale review via 7662e2b March 27, 2024 23:01
kushalkolar
kushalkolar approved these changes Mar 27, 2024
View reviewed changes
@kushalkolar
kushalkolar merged commit 97168ff into fastplotlib:main Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kushalkolar kushalkolar kushalkolar approved these changes
@clewis7 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

Labels

None yet

Projects

None yet

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.

3 participants

@BalzaniEdoardo @kushalkolar @almarklein
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.