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

Odd sprite generation - not following marked areas #7

Open
Haddicus opened this issue Jul 3, 2018 · 3 comments
Open

Odd sprite generation - not following marked areas #7

Haddicus opened this issue Jul 3, 2018 · 3 comments

Comments

@Haddicus
Copy link

Haddicus commented Jul 3, 2018

Was hoping to get this working, but the segmentation's seem not to be aligning properly with my sprites. I thought it was an issue with using a spritesheet, but have the same result when generating from an individual sprite.

Fragments Generated in editor:
image

Generated segments:
image

Not sure what's going on here, or if this is just broken in 2018.1.1f1

@Haddicus
Copy link
Author

Haddicus commented Jul 3, 2018

stool
Here's the sprite I'm trying to use for the test.

@clonzeh
Copy link

clonzeh commented Mar 11, 2019

i'm noticing this problem when a parent gameobject has different scale.

@clonzeh
Copy link

clonzeh commented Mar 12, 2019

update to this:
I have found some issues.
(Same applies to Triangle methods)
inside GenerateVoronoiPieces

  1. store the originalscale local scale in a separate vector3,
    set the origScale = the source.lossyscale
    at the bottom of the same method, set the source localscale to 1)
    inside GenerateVoronoiPieces
    set the piece localscale to the source lossyscale
    inside calcUV

change the textHeight and texWidth to divide by losscale instead of localscale.

Lastly, inside: the getRect(GameObject source) method,
set the return to:
return new Rect(sr.bounds.extents.x * -1, sr.bounds.extents.y * -1, sr.bounds.size.x * 2, sr.bounds.size.y * 2);

if that doesnt fix it also set change it from Renderer to SpriteRenderer

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

No branches or pull requests

2 participants