Rendering 2D sprites in a 3D world?

后端 未结 7 1211
情深已故
情深已故 2021-01-03 01:17

How do I render 2D sprites in OpenGL given that I have a png of the sprite? See images as an example of the effect I\'d like to achieve. Also I would like to overlay weapo

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-03 01:56

    You create a 3d quad and map the .png-based texture to it. You can make the quad face whatever direction you want, as in the first picture, or make it always facing the camera (like a billboard, mentioned by Svenstaro) as in your second picture. Though, to be fair, I am sure that second picture just blitted the image (with some scaling) directly in the software-created framebuffer (that looks like Wolf3d tech, software rendering).

提交回复
热议问题