-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Allow scaling a path-following CSGPolygon #2412
Comments
Thinking about it, isn't this a duplicate of #1062? I just reminded myself about that proposal. |
Yep, looks like a dupe. |
Oh true, it's similar, but not quite the same I think -- if I understand correctly, the other proposal is about being able to have a different CSGPolygon for the start and the end, while this proposal calls for being able to use the |
No I included a scaling mode in my code: godotengine/godot#41499
By default, if you did't modify the second array, the scaling mode is activate. If you modify the second array, the expand mode is activate. I like "expand" to call this mode :) Remember, that if you want scaling a perfect square, you have to set up yours arrays with the position 0, 0 as center. By default the path polygon make a rectangle in positive position. |
@kb173 I made a new pull request. godotengine/godot#53195 |
@stebulba Yes, this looks amazing! The x-axis scaling you show off in the first video is exactly what we need, given that we're working with streets. Thank you for your work! |
Describe the project you are working on
A landscape visualization which includes dynamically generated streets from geodata. For these, we have a CSGPolygon with a PoolVector2Array polygon, which is extruded along the paths representing the streets.
Describe the problem or limitation you are having in your project
We would like to generically resize that polygon without having to know its exact points, so that we can easily adapt any street profile to the exact width at that segment. For example, we would pre-define a street profile at a width of 2m and then dynamically adapt that width to the actual width at a given position. I had expected to be able to do this by setting the 'Scale' parameter in its Transform.
However, the scale entered in the CSGPolygon's Transform is only visible until a different node is selected; then is resets (only visually - the different value is still in the Transform). For the short moment where the scale is visible, it doesn't actually scale the polygon, but the whole mesh extruded along the path. This is the result I would expect when scaling the path, not the polygon.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Scaling the CSGPolygon by setting its 'Transform -> Scale' parameter should scale the polygon itself, so that a line which is extruded from it becomes thicker/thinner.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
There is no need for new editor tabs or code functions - the existing Scale from the Transform which CSGPolygon inherits from would be used as described above.
If this enhancement will not be used often, can it be worked around with a few lines of script?
With a scale of 1, everything will remain the same. The behavior for non-1 scale is changed - in a way, this breaks compatibility for projects which rely on the scale not affecting the CSGPolygon, but the current behavior seems more like a bug to me?
Is there a reason why this should be core and not an add-on in the asset library?
I intuitively expected scaling the CSGPolygon to have the result described above; I assume that it might be similar for others. Additionally, as I said above, the current behavior feels like a bug due to the short moment in which the scale is visible (in an unexpected way). Some type of change is required to clear up confusion (e.g. an editor warning when scaling a CSGPolygon, if this enhancement is not implemented).
(This supercedes godotengine/godot#32171)
The text was updated successfully, but these errors were encountered: