Friday, April 7, 2017

2d - xna: Methods for having sprite characters in 3d game?


Methods for having sprite characters in 3d game? I am making a game much like Doom. The world is 3d but objects and characters are 2d sprites. I am not asking about billboarding objects. I am asking about methods for having sprite characters that aren't always facing the player and have different frames depending on which way the character is facing. For example when an enemy is walking towards the player it is a 2d texture of a front and when walking away it is a 2d texture of a back.


One way I thought I read about was to draw a cube primitive that is "invisible". This 3d cube allows you to track the orientation of the character. Then you apply a sprite frame to each side of the cube but the 2d texture is only drawn on the side the player is looking at.



The other way I suspected I could do this is to make a 3d plane in a modeling program and import it to XNA. Then use the billboarding method to make sure the plane is always facing the player (you don't see the edge). Apply a the appropriate 2d texture (sprite frame) to the plane based on the direction the character is facing.


I know this is not how Doom did it but please tell me what you think of my ideas or a method on how this can be done.


Thank you.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...