Sign in to follow this  
Aragon

X file ... only 1 short question this time )

Recommended Posts

hi again ... last time i asked how i can accsess vertices of an mesh, i got accsess..but a bit other that i want ;) i got some piece of my code here: when nr==0 then it manipulating the correct vertices..but when nr==1 it does not change position of vertices 1..it change the textur coords of 0 ... when nr==2 it changes color of vertices 2 ... it drives me mad... what code is missing to get the right things... (nr==12 : position change of vertice #12) //------------------------------------- struct Vertex { D3DXVECTOR3 position; D3DXVECTOR3 normal; DWORD color; FLOAT tu , tv; FLOAT tu2, tv2; FLOAT tu3, tv3; enum FVF { FVF_Flags = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE |D3DFVF_TEX3 }; }; Vertex* pVertices; // -------------------------------------- g_pd3dDevice->SetFVF( Vertex::FVF_Flags ); LPDIRECT3DVERTEXBUFFER9 ppVB_edit = NULL; g_pMesh[55]->GetVertexBuffer (&ppVB_edit); int nr=12; ppVB_edit->Lock( 0, 1000*sizeof(Vertex), (void**)&pVertices, D3DLOCK_DISCARD ); //simple test pVertices[nr].position = D3DXVECTOR3(0,0,2*sin((water_offset*10)*3.141593/180)); ppVB_edit->Unlock(); ... g_pMesh[55]->DrawSubset(0);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this