Archived

This topic is now archived and is closed to further replies.

GeorgeV

Vertex buffer

Recommended Posts

I want to change the vertices properties in the vertex buffer, but this work ONLY ONCE, then the "pVertices[j].p *= xVariable;" line do nothing. What's wrong? Thanks: George Varga The Code for create: -------------------- m_pXFileObject = new CD3DMesh(); m_pXFileObject->Create( m_pd3dDevice, strXFileBuffer ); m_pXFileObject->SetFVF( m_pd3dDevice, D3DFVF_MODELVERTEX ); The Code for manage: -------------------- m_pXFileObject->GetSysMemMesh()->GetVertexBuffer( &pVB ); dwNumVertices = m_pXFileObject[x]->GetSysMemMesh()->GetNumVertices(); pVB->Lock( 0, 0, (BYTE**)&pVertices, 0 ); for( DWORD j=0; j < dwNumVertices; j++ ) { pVertices[j].p *= xVariable; } pVB->Unlock(); pVB->Release(); [edited by - GeorgeV on August 30, 2002 3:10:43 PM]

Share this post


Link to post
Share on other sites
Thanks for the answer.

The increment for "for" was correct, but the HTML list not show correct the for increment line. I changed.

George Varga


[edited by - GeorgeV on August 30, 2002 3:13:17 PM]

Share this post


Link to post
Share on other sites
Thanks for the answer.

I modified the code: must reinitialize the "DeviceObjects" with "m_pXFileObject" and "m_pd3dDevice", then I can modified the vertices in vertex buffer in every frame.

George Varga

Share this post


Link to post
Share on other sites