Original Post
Vertex buffers have been the bane of my existence for some time now, but I''ve finally decided to use them, as it''s the only way to get DX to actually give you the screen coordinates of the transformed points.
Here''s my code to fill a D3DTLVERTEX array with the transformed D3DLVERTEX array:
//now do the vertex buffer thing...
D3DLVERTEX* tv = new D3DLVERTEX[numvtx];
D3DTLVERTEX* tlv = new D3DTLVERTEX[numvtx];
if(FAILED(vb->Lock(DDLOCK_WRITEONLY, (void**)&tv, NULL)))Ending=true;
for(int i = 0; i < numvtx; i++)
{
tv = fvtx[i];
}
vb->Unlock();
if(FAILED(vbt->ProcessVertices(D3DVOP_TRANSFORM, 0, numvtx, vb, 0, d3d.D3DDevice, 0)))Ending=true;
if(FAILED(vbt->Lock(DDLOCK_READONLY, (void**)&tlv, NULL)))Ending=true;
for(i = 0; i < numvtx; i++)
{
tlvtx[i] = tlv[i];
}
vbt->Unlock();
There has got to be a better way to do this! Not only that, but this doesn''t work! Everything is properly inited, and no calls fail, but the tlvtx array doesn''t contain any useful data afterward!
~BenDilts( void );
Bean Dog