简体   繁体   English

OpenGL中的厚Bezier曲线

[英]Thick Bezier Curves in OpenGL

I am writing a program in java using the jogl opengl bindings. 我正在使用jogl opengl绑定在java中编写程序。 I need to create a bezier curve that varies in thickness along the curve. 我需要创建一条沿曲线变化的贝塞尔曲线。 So far I've only managed a thin bezier curve of single points. 到目前为止,我只管理了单点的薄贝塞尔曲线。 I'm pretty sure that this isnt going to be an easy thing to do, but i I have no idea where to even begin looking for the solution. 我很确定这不是一件容易的事,但我不知道在哪里开始寻找解决方案。 If anyone could point me in the right direction as to how to solve this, it'd be greatly appreciated! 如果有人能指出我如何解决这个问题的正确方向,我们将不胜感激!

James 詹姆士

Sample the curve and for each sample point compute two points, one on each side of the curve, along the normal line at the sample point and at a distance equal to the desired width at the sample point. 对曲线进行采样,并为每个采样点计算两个点,曲线每侧一个,沿着采样点的法线,并且距离等于采样点处的所需宽度。 This creates a polygon, which you draw as filled. 这将创建一个多边形,您将其绘制为填充。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM