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

Fix scale mean formula when one axis is flipped #68

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

D8H
Copy link
Contributor

@D8H D8H commented Sep 8, 2023

I'm maintaining an extension for GDevelop that uses three.quarks.
https://wiki.gdevelop.io/gdevelop5/extensions/particle-emitter3d/

GDevelop flips the Y axis to be consistent with its 2D rendering. Because of this, the scale is negative on one axis and the sum is 1 instead of 3. It results in particles being 3 times smaller than expected.

I guess that using absolute scale values should fix the issue.

@D8H D8H changed the title Fix scaling mean formula. Fix scale mean formula. Sep 8, 2023
@D8H D8H changed the title Fix scale mean formula. Fix scale mean formula when one axis is flipped Sep 8, 2023
Copy link
Owner

@Alchemist0823 Alchemist0823 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @D8H,
Thanks for the pull request and contribution. this makes sense. can you fix the / 3 on TrailBatch

@@ -246,8 +246,9 @@ export class TrailBatch extends VFXBatch {
this.widthBuffer.setX(index, current.size);
this.widthBuffer.setX(index + 1, current.size);
} else {
this.widthBuffer.setX(index, (current.size * (scale.x + scale.y + scale.z)) / 3);
this.widthBuffer.setX(index + 1, (current.size * (scale.x + scale.y + scale.z)) / 3);
const objectScale = Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing / 3 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, sorry 😅

@Alchemist0823 Alchemist0823 merged commit f0d20e7 into Alchemist0823:master Sep 8, 2023
@Alchemist0823
Copy link
Owner

Thanks for your contribution.

@D8H D8H deleted the fix-scale branch September 9, 2023 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants