Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How can I draw a 2D sprite to look like it's at a particular placement in the 3D world?

My goal is to use this as loose items in the world.

Minecraft Example: https://lh6.googleusercontent.com/-HMk5tW_cI-Y/TiYx71XkwtI/AAAAAAAAAZQ/jeaTfiMW1Ow/2011-07-19_20.26.18.png

share|improve this question

2 Answers 2

Traditionally, this is done by rendering a single quad with the sprite applied to it as a texture. The quad is generally rotated so that it always faces the player (usually only around the vertical axis).

share|improve this answer

You'd render a quad in 3D space, using the sprite as the texture for that quad. You can billboard that quad so that it always faces the player (this is what Minecraft does for its non-block inventory items when they're on the ground, if I recall correctly).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.