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

Ability to map meshes across curves #16322

Closed
MirceaKitsune opened this issue Feb 2, 2018 · 8 comments
Closed

Ability to map meshes across curves #16322

MirceaKitsune opened this issue Feb 2, 2018 · 8 comments

Comments

@MirceaKitsune
Copy link

I'm aware that for a game engine and map editor, this isn't a highly conventional feature. As a Blender artist and animator, I find myself making use of it often to efficiently achieve some environmental details. As worlds are often built into the editor rather than exported as a single 3D mesh, I believe this is a legitimate suggestion to consider.

I would very much appreciate the ability to loop and deform static meshes across curves, and / or to solidify curves into mesh cylinders. I'm suggesting a Godot equivalent for Blender's curve modifier, which can be used to map a model across a line in 2D / 3D space.

The main use for this feature would be world details such as pipes and wires: Using curves skinned with mesh segments, you can more easily add wiring and plumbing to a room! The ability would also be useful for mapping roads to terrain, once Godot also implements builtin support for heightmaps (issues #16299 #3616 #9046 etc)... this would additionally require the ability to project curves across mesh surfaces though. Lastly it would be a convenient way to create places such tunnels and sewers, by using an interior segment on a curve which steers the given tunnel.

@Zireael07
Copy link
Contributor

There are more uses for a spline/curve mesh than pipes and wires. Railings/barriers... it all depends on the static mesh you use.

@pgruenbacher
Copy link

checkout the CSG module. it allows for extruding meshes along a path. It's pretty much exaclyt what you want I think. This is an example for raod and railings: https://www.youtube.com/watch?v=Yvy8vQ-5O_w&t=308s

@akien-mga close?

@BastiaanOlij
Copy link
Contributor

I second @pgruenbacher remark, the CSG module recently added to 3.1 is pretty much what you're looking for.

You can also create much of the rest of the logic you're after. My video referenced above shows how to extrude the road from a curve, but you can easily add logic to the script to sample the heightmap at the coordinates of the points of the curve and adjust the height of each point.

@MirceaKitsune
Copy link
Author

Will everything shown in that video be included with Godot 3.1 by default? That's fantastic news if so! It didn't explain whether a 3D mesh object can also be looped and bent across a curve, but it's by far good enough for most use cases.

My remaining curiosity is whether the curve will be possible to project onto other models in a given direction. Namely over terrain once the terrain module is also in. Mapping roads is going to be very tricky if you're going to have to adjust each point on the curve to try and estimate the terrain manually, especially if the ground has more roughness than the curve can normally handle.

@BastiaanOlij
Copy link
Contributor

Yes, everything I used in that video is now part of the 3.1 release.

There isn't a mesh distortion option yet. You can do boolean operations with any mesh but no fancy bend a mesh along a curve thing. I am working on some code that may end up supporting something like that but that is still a long way off.

Adjusting the curve to follow the height of the terrain is something that you would do in code, so you would draw out the curve to get the shape of the road right, then have code run over that curve to adjust the height of each point and add additional points where needed to follow the terrain. I might attempt to build something as part of my demo when I have some time. It's all theory at this point :)

@Calinou
Copy link
Member

Calinou commented May 26, 2020

This feature can now be achieved using the CSG module, closing.

@Calinou Calinou closed this as completed May 26, 2020
@Calinou Calinou added this to the 3.1 milestone May 26, 2020
@YBPN
Copy link

YBPN commented Sep 13, 2020

I wonder if this could be opened again? I don’t think the CSG module is the full answer to this proposal/feature request (“ability to map meshes across curves”). It would be still be very useful to have a curve modifier that can be applied to any mesh.

This is not the same as extrusion. As @Zireael07 says, you can take any non-curved mesh (a snake, railings, a flight of stairs, a wall...) and produce curved versions of them. Dynamically changeable curve deformations would be so useful! I was looking for something like this for an abstract-3D project I had in mind.

I found this https://github.com/TheFamousRat/MeshCurver but I haven’t tried it yet.

@Calinou
Copy link
Member

Calinou commented Sep 13, 2020

@YBPN Please open a proposal on the Godot proposals repository, as this issue tracker is now meant to be used for bug reports only. Make sure to explain why CSG doesn't suit your needs in the proposal. (If you think performance might be an issue, try it in a real-world project first.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants