struct CUSTOMVERTEX { float x,y,z; }; CUSTOMVERTEX Vertices[] = { {-5.0, -5.0, 0.0}, { 0.0, 5.0, 0.0}, { 5.0, -5.0, 0.0}, {10.0, 5.0, 0.0}, {15.0, -5.0, 0.0}, {20.0, 5.0, 0.0} };
// // It is assumed that d3dDevice is a valid // pointer to a IDirect3DDevice9 interface. // d3dDevice->DrawPrimitive( D3DPT_POINTLIST, 0, 6 );//表示从0个顶点开始、一共6个
点比较小、。看不清楚
具体代码可以自己添加在 sdk自带的samples的tutorials 里面。
d3dDevice->DrawPrimitive( D3DPT_LINELIST, 0, 3 );效果:
d3dDevice->DrawPrimitive( D3DPT_LINESTRIP, 0, 5 );
具体效果自己尝试。会发现3个点能组成2条线Directx9.0 学习教程3 -图形学之创建点 线 三角形 等
原文地址:http://blog.csdn.net/cq361106306/article/details/39641861