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

Z sort override per Shape #73

Open
bendablegears opened this issue Jun 18, 2019 · 4 comments
Open

Z sort override per Shape #73

bendablegears opened this issue Jun 18, 2019 · 4 comments
Labels
feature request New feature or request

Comments

@bendablegears
Copy link
Contributor

Currently, in order to change the render order of a Shape one has to add it to a Group along with additional invisible Shapes in order to nudge the Z sort to the desired position. It would be nice if one could specify a point that, if set, updateSortValue would use instead of calculating average Z.

@desandro
Copy link
Member

Add a 👍 reaction to this issue if you would like to see this feature added.


Wow, this is a good idea. I hadn't thought of adding a per-shape override like you suggest.

@desandro desandro added the feature request New feature or request label Jun 18, 2019
@shm-sl
Copy link

shm-sl commented Jul 3, 2019

So with this feature we would be able to solve this bug, right? https://codepen.io/anon/pen/oryxRJ
Or is that already possible?

@desandro
Copy link
Member

desandro commented Jul 3, 2019

This feature would make it easier to implement some of the Z-fighting techniques I propose here. Rather than relying on Group with an addition Shape, you would hard-code in where you want the sorted position to be.

As for that gear icon: that's a tricky tricky issue with figuring out which one of the side shapes is 'in front' of the top gear shape. Zdog is not optimized for those kind of polygonal models. But there are some techniques to possibly resolve it.

@bendablegears
Copy link
Contributor Author

For the gear; simply putting the polygons into an updateSorting Group does the right thing; Z sort for Groups works with average Z for all the members in a Group.

https://codepen.io/anon/pen/pXKEKX

The proposed feature is more about getting non-symmetric shapes or groups of shapes to Z sort well without having to use invisible shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Development

No branches or pull requests

3 participants