开发者

Direct3D Viewports within viewport

开发者 https://www.devze.com 2023-02-27 17:51 出处:网络
I\'m creating an AutoCAD viewer using directX, and am trying to implement paperspace/modelspace functionality.

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!


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. ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消