Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Creating smooth quadric bezier curves for any length and angle?

$
0
0
Hi I have a basic setup currently where i create a quadratic bezier curve, and then i do 100 steps across the curve to calculate its distance. And from that i do distance / 3 to give me the total number of segments. Its pretty quick but its not a good solution for very large distances (too many segments) and then for very small distances (too few segments). Here is a visual issue of the problem: 7 looks reasonable (though i actually think it computed 6 my mistake), but for something much shorter 2 simply doesn't cut it neither would 3 or 4 to be honest. So i am wondering what is a common way to balance this so they are smooth regardless of length and sharpness of the angle ? I use C# but I'm just looking for a logical approach here not how to implement it in code since i'm sure i can handle that myself Thanks in advance.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>