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

Free-form line in 3D space

$
0
0
Hi, I want to use a 3D mouse to draw free-form line in 3D space using DirectX11. I have a question about how to create vertex buffer. Please see comments in the following code. struct SimpleVertexCombined { XMFLOAT3 Pos; XMFLOAT3 Col; }; D3D11_BUFFER_DESC bufferDesc; bufferDesc.Usage = D3D11_USAGE_DYNAMIC; bufferDesc.ByteWidth = ???;//the size will change dynamically, how to fill this part? bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; bufferDesc.CPUAccessFlags = 1; bufferDesc.MiscFlags = 0; After I create a dynamic vertex buffer, I use Map and UnMap to update the buffer. How to incrementally update the buffer? Any comments about how to do free-form line drawing in 3D space are really appreciated. Many thanks. YL

Viewing all articles
Browse latest Browse all 17825

Trending Articles



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