question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rotation on center pivot not maintained with multiple containers.

See original GitHub issue

Expected Behavior

I set the pivot point to center on an outer and an inner container, and then add one rectangle to the inner container.

When I set an angle on the inner container the rectangle rotates on its center point. I would expect the same on the outer container, but that’s not happening.

Current Behavior

Setting the outer container has the correct rotation, but the center point moves.

Possible Solution

Unfortunately I don’t know what’s causing it, so that makes it hard to offer a solution.

Steps to Reproduce

I’ve created 3 fiddles for you to see what’s going on.

This one shows the correct rotation on the inner container: https://jsfiddle.net/y3j2tLd8/15/

This one shows the incorrect rotation on the outer container: https://jsfiddle.net/y3j2tLd8/13/

This one shows that the rotation becomes correct on the outer container if I move the y position to the outer container (no idea why that affects it): https://jsfiddle.net/y3j2tLd8/14/

Environment

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bigtimebuddycommented, Mar 18, 2021

You need to offset the pivot of the outer Container. https://jsfiddle.net/bigtimebuddy/Lx370h5b/

Please keep in mind that pivot and position are basically the same thing in PixiJS. Pivot defines the origin for children of a Container and position is the local position in the parent’s coordinate space. In CSS and other rendering systems the origin and pivot are sometimes treated separately. It’s a quirk about PixiJS that takes getting use to.

0reactions
bigtimebuddycommented, Mar 18, 2021

You’re welcome, good luck!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CENTER PIVOT IRRIGATION HANDBOOK
Reference to commercial products or trade names is made with the understanding that no discrimination is intended of those not mentioned and no...
Read more >
Pivot: Questions & Answers - Wade Rain
Yes. The pivot rotates continuously when it is irrigating. Each tower moves in short intermittent steps to maintain its alignment. How many acres...
Read more >
CENTER PIVOT IRRIGATION - USDA ARS
A center pivot machine rotates around a “pivot” point in the center of the field whereas a lateral move machine travels along a...
Read more >
Center Pivot Irrigation - Rio Grande Water
The required hydraulic oil pressure (1,500 to 1,800 psi) is maintained by a central pump usually located near the pivot pad. The central...
Read more >
Optimal Performance from Center Pivot Sprinkler Systems
Composite application rate pattern under a center pivot from 6-groove rotating-plate sprinklers on drop tubes with 10-foot sprinkler spacing and 10 gallons-per-.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found