is there a way to clip drawed texture? (ID3DXSprite)

Started by
10 comments, last by Craazer 20 years ago
Sorry for raisin this post but I still strugle whit clipping.

I found SetClipStatus(); but that works only whit software draw operations.

Then there is SetClipPlane(DWORD Index,const float *pPlane); but I have no idea what comes as index and pPlane.. sure I read what doc said but I think that this is more like 3D clipping wich I dont know nothing about.

And I was reading about the Projection Transformation and the matrix wich lead me to this code:
D3DXMATRIX matrix;RECT rect = {0,0,300,300};D3DXMatrixPerspectiveOffCenterLH(&matrix,rect.left,rect.right,rect.top,rect.bottom,-1,1);pD3DDevice->SetTransform(D3DTS_PROJECTION,&matrix);



But that clips everything, any tips?
Advertisement
I was looking into this, and I found a great source right in the SDK (at least in version 8 I don''t know if it''s the same, or even in version 9). It''s called Clip Mirror and it demonstrates how to use clip planes.

Basically since you''re doing 2D you''d just make your clip rectangle out of the 4 planes just like in the example. I haven''t tried it myself yet...

Good luck.

This topic is closed to new replies.

Advertisement