プレイ日記
Oscar PwnageBlock
Working on Bézier curves... I need to figure out how to draw them recursively, preferably with as few iterations as possible.
8そうだね
プレイ済み
返信[1]
親投稿
Aaron Krondelo
What is the best way to draw curves in SB? You just using the pixel command?
0そうだね
プレイ済み
返信[2]
親投稿
12Me21 12Me21
I bet you could use a ton of arcs (using the CIRCLE command) instead of drawing one pixel at a time.
0そうだね
プレイ済み
返信[3]
親投稿
Oscar PwnageBlock
I'm calculating individual points in the curve (one for each iteration) and then connecting those points with lines.
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
It becomes clear when its set to very few iterations.
0そうだね
プレイ済み
返信[5]
親投稿
12Me21 12Me21
Oh, I see. Now, hopefully there is a simple way to replace the lines with arcs to make it look smoother
0そうだね
プレイ済み
返信[6]
親投稿
Oscar PwnageBlock
Sadly, I don't think there is a simple way to replace the lines with arcs, at least not in a way that would be more efficient than using more iterations. Using a couple hundred iterations doesn't take that long (It renders in less than a frame) and doesn't look that bad, anyways.
0そうだね
プレイ済み
返信[7]
親投稿
Aaron Krondelo
Interesting, thats exactly what I wanted to know. Yeah, makes sense to draw more straight segments. I think its smooth enough.
0そうだね
プレイ済み
返信[8]
親投稿
Oscar PwnageBlock
Recursive method and higher order curves are now done! I'm not sure if I should release this or not. All it does is trace curves, after all.
1そうだね
プレイ済み
返信[9]
親投稿
12Me21 12Me21
I think you should (maybe you could just post the code if it's short enough)
0そうだね
プレイ済み
返信[10]
親投稿
Alex MrCashews
Nice work. I've written my own code to draw n-order beziers since since back in PTC (I've since ported it) and we seem kinda similar. Maybe we should compare? ;)
1そうだね
プレイ済み
返信[11]
親投稿
Oscar PwnageBlock
Well, I guess publishing it can only benefit other people. I'll post the key in another play journal entry. Until then, here's the algorithm itself.
0そうだね
プレイ済み