1
votes

I'm creating an AutoCAD viewer using directX, and am trying to implement paperspace/modelspace functionality.

Basically, rendering everything again within a scaled, translated and rotated viewport on a 2D surface in the world.

I know this could easily be achieved by seperately rendering everything to a texture and then mapping that texture to a polygon, but that would devectorise everything and possibly be less effecient.

In GDI+ it's done by setting a clipping rectangle, performing the transformations, and then drawing everything.

Is there a reasonably straightforward equivelant in Direct3D to GDI's Graphics.SetClip, or some other way of achieving this?

I seem to recall from playing Half Life 2 that it has been done, although I don't know how that implementation was achieved; hence tagged with games development as it's probably more common and relevant to games development. Sorry to be a boring old fart!

1

1 Answers

0
votes

What you need is scissor test. Same feature is available with D3D10/11.

And don't be sorry, it's not bad to do CAD with DirectX. ;)