The idea is fairly simple. I have a road texture, and I want to apply it to a mesh generated from a curved path, so that I can easily make roads from curves rather than have to carefully create and place a bunch of road textures. I thought I had it figured out after much trial and error, but the biggest problem I'm still getting is where the path will "fold over" itself and any path going vertically is completely screwed up.
Attached is a bunch of disorganized code with my current efforts. The current main.lua in it has what has worked best so far, with the exception of the vertical issues. I would really appreciate any help with this or libraries I could use to achieve the desired effect.
(Note: There is this outdated "trail mesh" library, which I have attempted to update with limited success. (It seems to be based in a version of Love prior to 0.8.0, using "additive" blend mode instead of "add", and a removed variant of love.graphics.newMesh(). Other than that, there's an error in its update function once you fix those and setting the textures correctly.)
[Help Requested] Making a mesh follow a Bezier Curve
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Guard13007
- Party member
- Posts: 132
- Joined: Sat Oct 25, 2014 3:42 am
- Location: Internet, USA
- Contact:
[Help Requested] Making a mesh follow a Bezier Curve
- Attachments
-
- crappy mesh maker.love
- (4.16 KiB) Downloaded 81 times
Re: [Help Requested] Making a mesh follow a Bezier Curve
You may read the basics here:
http://www.redblobgames.com/articles/curved-paths/
http://www.redblobgames.com/articles/curved-paths/
Re: [Help Requested] Making a mesh follow a Bezier Curve
Ulydev has created a trail library that works in 0.10.x, but it can be somewhat wonky at times.
https://github.com/Ulydev/trail
Maybe it can help you.
https://github.com/Ulydev/trail
Maybe it can help you.
- Guard13007
- Party member
- Posts: 132
- Joined: Sat Oct 25, 2014 3:42 am
- Location: Internet, USA
- Contact:
Re: [Help Requested] Making a mesh follow a Bezier Curve
Well I'm glad to know there's a working version of that, but I'm having trouble understanding it, and maybe I needed to be more clear. I don't need a dynamic mesh that updates and follows something or any of that stuff, I need a static mesh generated from a bezier curve, and I can't figure out how to do it. I always get weird errors when I try it. :/Tjakka5 wrote: ↑Sun Apr 23, 2017 12:56 pm Ulydev has created a trail library that works in 0.10.x, but it can be somewhat wonky at times.
https://github.com/Ulydev/trail
Maybe it can help you.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 42 guests