XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Any tips on putting a viewable camera-monitor within the game?

Last post 11/12/2008 11:21 PM by Kmullins. 2 replies.
  • 11/12/2008 10:50 PM

    Any tips on putting a viewable camera-monitor within the game?

    I'd like to be able to put a viewable screen that shows a camera's view within my game. For example, back in the Duke Nukem days you could look at some TV's and see what's going on in a different area.

    I know how to setup a camera and create a view matrix. I just don't know how I would put it into the game as a 2d surface.

    I thought maybe I could create another viewport to draw the camera view too, grab some periodical "screen shots" as a 2d texture, and then wrap it on to a 3d object -- but I'm not sure how I would do that.

    If anyone has any tips on this to share, I would appreciate it.

    Thanks.
  • 11/12/2008 10:54 PM In reply to

    Re: Any tips on putting a viewable camera-monitor within the game?

    First draw your entire world from the perspective of this camera, into a rendertarget.

    Then draw the world again, from the perspective of the main camera, into the main backbuffer, and map that rendertarget texture onto your 3D object that represents the screen.

    This obviously gets increasingly slow the more such screens you have, as you can end up rendering the world many times over!
    XNA Framework Developer - blog - homepage
  • 11/12/2008 11:21 PM In reply to

    Re: Any tips on putting a viewable camera-monitor within the game?

    Sounds fairly straight-forward. I'll try it out. Thanks.
Page 1 of 1 (3 items) Previous Next