[Help Requested] Making a mesh follow a Bezier Curve

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
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

Post by Guard13007 »

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.)
Attachments
crappy mesh maker.love
(4.16 KiB) Downloaded 81 times
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: [Help Requested] Making a mesh follow a Bezier Curve

Post by MasterLee »

User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Re: [Help Requested] Making a mesh follow a Bezier Curve

Post by Tjakka5 »

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.
User avatar
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

Post by Guard13007 »

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.
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. :/
Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests