使用 Direct3D 绘制带有圆角末端的线条
有没有办法使用 ID3DXLine 画一条带有圆形结尾的线?我试图根据线段的数量绘制一条曲线,但获取线段连接的空白区域。 这里的性能至关重要。
谢谢!
还有其他使用 D3D 绘制粗曲线的快速方法吗?
Is there any way to draw a line using ID3DXLine with round endings? I am trying to draw a curve from number of line segments, but getting the empty areas where the line segments are connecting.
Performance here is essential.
Thanks!
Any other fast way to draw thick curved line using D3D?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您最好使用圆形纹理(边缘周围具有抗锯齿功能),然后在线的任一端绘制一半纹理。然后,您可以沿着围绕线的矩形全程渲染穿过纹理中心的条带,然后在另一端完成纹理的另一半。这会给你想要的效果,但它比简单地调用“DrawLine”或其他什么更复杂......
You would be best off using a circular texture (with antialiasing around the edges) and then drawing half the texture at either end of the line. You can then render a strip through the center of the texture the whole way along a rectangle surrounding the line before finishing off with the other half of the texture at the other end. This will give you the effect you are after but its a tad more involved than simply calling "DrawLine" or whatever ...