   DrawPrimitive sprite move
  HelloI'm trying move a sprite using custom vertex using D3DFVF_XYZRHW.my code work to move sprite only when i set the position in OnCreate of my window...dont have a way to move it in runtime?my code is here:http://www.lordzero.co.nr/tmp/DrawPrimitive.zipGreets   
  I haven't looked at your code; you're more likely to get people looking at it if you paste the relevant parts here in [ source ] tags.I bet you're trying to use a transform matrix to move your vertices. D3DFVF_XYZRHW vertices don't have any transformations applied to them, so you'll either have to update the vertex buffer every frame to move them (Make sure you use a dynamic VB), or use an orthogonal projection matrix and use untransformed vertices.   ;Quote:Original post by Evil SteveI haven't looked at your code; you're more likely to get people looking at it if you paste the relevant parts here in [ source ] tags.I bet you're trying to use a transform matrix to move your vertices. D3DFVF_XYZRHW vertices don't have any transformations applied to them, so you'll either have to update the vertex buffer every frame to move them (Make sure you use a dynamic VB), or use an orthogonal projection matrix and use untransformed vertices.yeah,  updatting the vertex buffer every frame already working! :)with orthogonal projection the performance is better of D3DFVF_XYZRHW vertices?and about the performance... do u know how to otmize my vertex using D3DFVF_XYZRHW? such as batching or other issue...Greets ;Quote:Original post by lordzerowith orthogonal projection the performance is better of D3DFVF_XYZRHW vertices?and about the performance... do u know how to otmize my vertex using D3DFVF_XYZRHW? such as batching or other issue...GreetsOrthogonal projection will be a bit more efficient, yes - and you get rotation for "free".As far as optimising vertex usage goes, it's just the same as any other format. Indexed is better, and ordering vertices to use the vertex cache efficiently is good. That's about it.   ;Quote:Original post by Evil SteveQuote:Original post by lordzerowith orthogonal projection the performance is better of D3DFVF_XYZRHW vertices?and about the performance... do u know how to otmize my vertex using D3DFVF_XYZRHW? such as batching or other issue...GreetsOrthogonal projection will be a bit more efficient, yes - and you get rotation for "free".As far as optimising vertex usage goes, it's just the same as any other format. Indexed is better, and ordering vertices to use the vertex cache efficiently is good. That's about it.thanks;Quote:Original post by Evil SteveQuote:Original post by lordzerowith orthogonal projection the performance is better of D3DFVF_XYZRHW vertices?and about the performance... do u know how to otmize my vertex using D3DFVF_XYZRHW? such as batching or other issue...GreetsOrthogonal projection will be a bit more efficient, yes - and you get rotation for "free".As far as optimising vertex usage goes, it's just the same as any other format. Indexed is better, and ordering vertices to use the vertex cache efficiently is good. That's about it.hey other guy talked about that 3D projection can be not good because won't give pixel-perfect results mainly because you need to use direct mapping of textels to pixels. what do u think about it?   ;  It's fine so long as you offset all your vertices by -0.5 in X and Y. There's a bit in the SDK Docs about it.EDIT: ID3DXSprite uses an orthogonal projection matrix, and my engine code uses this method too. Using transformed vertices means you're not making use of part of the GPU and doing all the hard work on the CPU (Only really an issue with rotated quads that is) - something hardware vertex processing was designed for in the first place.   