Vertex buffer

Started by
2 comments, last by GeorgeV 21 years, 7 months ago
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]
Advertisement
Either your code was cut off or your for-loop cannot do something because the counter ist not incremented.
Im Anfang war die Tat...Faust
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]
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

This topic is closed to new replies.

Advertisement