NaughtyBezierCurves | Bezier Curve Game Object for Unity | Editor library
kandi X-RAY | NaughtyBezierCurves Summary
kandi X-RAY | NaughtyBezierCurves Summary
NaughtyBezierCurves is an extension for Unity that provides a BezierCurve GameObject.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NaughtyBezierCurves
NaughtyBezierCurves Key Features
NaughtyBezierCurves Examples and Code Snippets
Community Discussions
Trending Discussions on NaughtyBezierCurves
QUESTION
I want to dynamically draw 2D road segments in Unity. I know the 4 edge points of the segment and the required control points for the bezier curves. This allows me to draw the outer shape of the road segment pretty easily, wich results (in this example) in 2 end lines and 2 curves that form the shape of the road.
To draw the bezier curves, I am using this: https://github.com/dbrizov/NaughtyBezierCurves
This is what the outer shape looks like
The goal is to fill the road segment with some texture. How can I create some sort of planes or mesh that would have the same shape of the road?
My first idea was to go along both curves and create planes, maybe every 1/100 lenght of the curve, and add the texture to them. But with this approach, I dont know how to rotate the planes or how to prevent spaces or overlapping. Maybe someone has a simpler solution for this problem.
...ANSWER
Answered 2020-Jan-14 at 14:49I took DShook's answer from a related question and changed a few lines to make it take two arbitrary splines:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NaughtyBezierCurves
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page