-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add Grid gizmos #11988
Add Grid gizmos #11988
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the examples and they are fine and I'm not a math guy, but the implementation seems fine too, my only point is about grid_2d
since to me both grids are 2d
, since a grid_3d
would means, at least to me, a "cubic grid" not a "square grid".
IMO we should have only grid
and showcase how to use them in 2d_gizmos
and 3d_gizmos
.
I get the confusion, but this follows the naming conventions for other gizmos like |
Sorry if I wasn't clear, but my point is I don't think we need a |
Yes, this would still provide all the functionality, but isn't approachable for new users. Imagine someone building a 2D game: they have only dealt with |
In reality, would be good to have a cubic grid IMO. And one could find good to be able to change the space between X lines and Y lines. (In the cubic grid example, we would have Z lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe change the color of the grid lines in the example? It was a bit hard to me to see at first. Maybe we can use white?
I'm not sure I understand this . You can have different spacings for x and y lines already. Simply pass something like |
Not really, I'm saying thats good, sorry, wasn't clear. |
But as follow-up PR, right? Because I think a cubic-grid is out of scope of this PR, since this can be controversial, since the implementation can be trick IMO. |
White was a bit overwhelming, but it should be better now. |
Yea, we can track this in #9400 |
I think I could add this here, if that is ok. It would be just adding another axis to the existing implementation and something like |
If we implement in the same way that is now, I think that's okay, but might be good keep this as uncontroversial as possible and do this in a follow-up? Not sure. |
Ok, fair enough. As for the name, we already have |
Keeping |
Ok, so we will add that functionality to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The math behind this looks fine to me, and nothing to say about the grid itself. All good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New to gizmos, so seeing Drop
used for finalizing the builder was interesting
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Drop
pattern is a little too clever for my taste, and doesn't appear to be used elsewhere in gizmos. Can we find a simpler solution?
oh, I thought it was a standard for gizmos so I didn't question it |
I'm a little confused, isn't the drop pattern used in multiple gizmos builders? Or is there something different here? For starters, arc builders use this |
Yes, the |
Ah my apologies, I did a search for |
@solis-lumine-vorago can you rebase (the examples got moved) and I'll give this a final pass before merging? |
Head branch was pushed to by a user without write access
Yeah sure, it appears that |
@alice-i-cecile Could you enable Auto-merge again, please :) |
thx :D |
Objective
Solution
gizmos.grid(...)
andgizmos.grid_2d(...)
.outer_edges(...)
to specify whether to draw the outer border/edges of the grid and.skew(...)
to specify the skew of the grid along the x or y directions.Changelog
grid
module tobevy_gizmos
containinggizmos.grid(...)
andgizmos.grid_2d(...)
as well as assorted items.2d_gizmos
and3d_gizmos
examples to use grids.Additional
The 2D and 3D examples now look like this: