In several other contexts, in 2D (Android’ Canvas, GDI’ Graphics) I used to clip my drawings before calling the drawing methods.
How could I achieve this with XNA?
I am drawing some primitives thanks to DrawUserPrimitive and have not yet found any method to clip these primitives. Is it possible? How?
Would changing the viewport or something like this permit this? When using a BasicEffect there also are World, Viewand Projection matrices. I have not dig into these yet.
a. You can change the viewport
b. You can use an scissor rectangle… setting a rasterizer state with scissor test enabled…
c. You can use stencil buffer and stencil operations.. basically this method is about creating a mask and applying it
d. You can clip before draw…