vertex rhw and camera in 2D,
Members - Reputation: 241
Posted 09 December 2012 - 07:57 PM
i got some questions here.Thanks for you guys's helping(before)!
i want to draw 2D object.
if i don't use rhw in the vertex,i can use SetTransform(D3DTS_VIEW) for setting the position of camera or somethings special.And i can use SetTransform(D3DTS_TEXTURE0) for setting the texture's matrix.
But if i use rhw,i can't do that,i call SetTransform(D3DTS_VIEW) but it doesn't change.I don't want lock vertex,can i change camera?
Well,yesterday i don't use rhw to simulate rhw,it works but do we have other method?
The code of below:
int width=792;//the width of view area
int height=566;//the height of view area
D3DXMATRIX V;//the matrix of view
D3DXMatrixTranslation(&V,-(width/2),height/2,-1);//if i don't use rhw,the point(0,0) is in the middle of view area,and x-axis is up, y-axis is right
//lock vertex,change y to negative
i don't know does this method good or not,if you have better method, please tell me.
Crossbones+ - Reputation: 5118
Posted 09 December 2012 - 11:19 PM
For the vertices this means, either Lock/Modify/Unlock or use DrawPrimitiveUP. Depending on the amount of change the objects both may be fine. The first (vertex buffers) are better for static objects, the latter for dynamic.