   Swapping between 2D and 3D drawing modes
  Hello again, GameDev. Here's a bit of background behind what I'm trying to accomplish: After rendering my 3D game world I want to render a simple 2D HUD on top of that. To start, I want to draw a simple, untextured solid triangle to the screen.The problem is I'm not really sure how to approach this.In the past, I've used an XYZ vertex format for 3D drawing and an XYZRHW vertex format for 2D drawing. Does this mean I'll have to swap between vertex formats to swap between 3D and 2D drawing? Or is it better to just set up the view/projection matrices in such a way to accomplish the same effect?Second issue, render states and matrices. Anything I should reset before swapping to 2D drawing? Any other pitfalls I should look out for?Thanks for your time,theJ89   
  Changing vertex format will work fine, as will changing to an orthographic projection. I'd suggest using the projection matrix, as it's easier to adapt it for differing screen resolutions and aspect ratios (5:4, 4:3, 16:10 and 16:9 are all commonly used).For render states to change the obvious one is disabling the z-buffer.   ;  I have been working on a similar thing for my game. I just created a secondary stationary orthographic camera that I used to draw my HUD. And I just drew to that last in my draw method.Hopefully this helps.   ;  Could you not simply set the world and ViewProj matrices to identity then set your rectangle vertices from 0-1 for width and height. They won't get transformed through the vertex shader so it'll be easy to set the locations on screen for GUI elements.   