使用 Direct3D 繪製帶有圓角末端的線條 (Drawing lines with rounded endings with Direct3D)


問題描述

使用 Direct3D 繪製帶有圓角末端的線條 (Drawing lines with rounded endings with Direct3D)

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?

‑‑‑‑‑

參考解法

方法 1:

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 ...

(by stiopaGoz)

參考文件

  1. Drawing lines with rounded endings with Direct3D (CC BY‑SA 3.0/4.0)

#slimdx #direct3d #directx






相關問題

使用紋理作為渲染目標時的大小限制 (Size limitation when using a texture as a render target)

如何安全地將事件傳遞到線程中。SlimDX / DX9 (How to safely pass events into a thread. SlimDX / DX9)

將directdx轉換為slimdx (Converting directdx to slimdx)

Toán véc tơ nhanh trong .NET - Các tùy chọn là gì? (Fast Vector Math in .NET - What are the options?)

DirectX10/ShapDX 自定義控件 (DirectX10/ShapDX Custom control)

使用 GDI 繪製散點圖太慢 (Drawing scatter plot is too slow with GDI)

防止 Direct3D 視口圖像縮放 (SlimDX) (Prevent Direct3D viewport image from scaling (SlimDX))

如何使用 SlimDX 設置 HLSL 統一變量的值? (How do I set the value of a HLSL uniform variable with SlimDX?)

使用 Direct3D 繪製帶有圓角末端的線條 (Drawing lines with rounded endings with Direct3D)

如何使圖元在 DirectX (2D) 中正確覆蓋精靈 (How to make primitives correctly overlay sprites in DirectX (2D))

多個渲染目標不保存數據 (Multiple Render Targets not saving data)

SlimDX VertexDeclaration 內存洩漏?- 如何避免? (SlimDX VertexDeclaration memory leak? - How to avoid it?)







留言討論