XNA: draw a sprite in 3d, is that possible?

Posted by Heisenbug on Game Development See other posts from Game Development or by Heisenbug
Published on 2011-11-24T15:38:14Z Indexed on 2011/11/25 2:20 UTC
Read the original article Hit count: 205

Filed under:
|
|
|

since now I always used sprited to draw in 2D:

spriteBatch.Draw(myTexture, rectangle, color);

(I suppose the texture is binded internally to 2 triangles and then scaled.)

Now, I'm porting my game in 3D and I have to draw several planes (walls, floor, roof,..). Do I need to manually binding a texture to a geometry (for example using VertexPositionColorTexture with VertexBuffer and IndexBuffer), or is there any simpler way to do that?

I'm looking for something like spriteBatch.Draw with the rectangle clip specified in 3d space:

spriteBatch.Draw(myTexture, rectangleIn3D, color);

© Game Development or respective owner

Related posts about XNA

Related posts about c#