T.A.C. Commandeur
T.A.C. Commandeur

Reputation: 250

XNA 2D objects in 3D environment

I'm currently working on a 3D game in XNA 4.0 and I have a 3D environment, a controllable character and a camera that follows the character up and running. But now I would like to draw 2D images in the 3D environment. The reason for 2D images is that I want Legend of Zelda Windwaker like explosions.

Can anyone give me recourses, advice or code snippets (in case it's really simple) on how to build this?

Upvotes: 1

Views: 366

Answers (2)

jalgames
jalgames

Reputation: 789

You can use the MAtrix.CreateBillboard-Method to rotate a plane coorectly: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.matrix.createbillboard(v=xnagamestudio.40).aspx

Upvotes: 1

Lucius
Lucius

Reputation: 3745

The effect you are trying to achieve is called billboarding. A quad is placed into 3D space and rotated in a way so that it always faces the camera (spherical billboarding). Billboards can also be restricted to rotate around a single axis (cylindrical billboarding).

Upvotes: 3

Related Questions