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

How can I obtain a projection matrix and view matrix for the default camera?

Last post 7/15/2009 2:17 PM by Mithra. 1 replies.
  • 7/15/2009 4:25 AM

    How can I obtain a projection matrix and view matrix for the default camera?

    Hey guys,

    I've got a 2D game design and I'm trying to display an ocean quad on the screen and then plant my 2D tiles over it using SpriteBatch.  The problem is that the vertex shader requires a world and projection matrix, and I'm not sure where to acquire this information.  My 2D game design hasn't required that I create a camera, and I assume there is a default camera somewhere I can reference?  The tutorials I'm looking at assume a 3D design and create a camera, but I don't want to retard the SpriteBatch part.  Am I thinking about my problem wrong?  Should I create a special camera and rendertarget for the ocean effect, and just stamp it in the sprite pass instead?  Or is there a simpler way?  Any input would be appreciated!
  • 7/15/2009 2:17 PM In reply to

    Re: How can I obtain a projection matrix and view matrix for the default camera?

    I guess I answered my own question.

    Apparently I need to create a camera, obtain a world matrix, render my triangle list, and then I can use SpriteBatch normally over the top.  I was concerned at first creating a camera would leave the renderer in an unusable state for SpriteBatch but that isn't the case.
Page 1 of 1 (2 items) Previous Next