Archived

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

Vertex buffer

This topic is 5582 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.

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