🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Explain like I'm five, how do I combine 2d sprites with 3d scenes?

Started by
5 comments, last by Tom Sloper 3 years, 6 months ago

Hello everyone

So I have been working with OpenGL a lot and I can render 2d scenes and 3d scenes just fine on their own but I feel kinda lost on how to combine 2d sprites in 3d scenes. Do I need to render my 2d objects in 3d space? Do I need to render 2 different cameras for 2 different perspectives? Any tricks or tips would be greatly appreciated

Thank you

Advertisement

2D objects in 3D space are commonly referred to as billboards. Just search google for ‘opengl billboards’ and you'll be well on your way to graduating kindergarten at the top of the class.

“Do I need to render 2 different cameras for 2 different perspectives?”
I have a 2D HUD in a 3D FPS that just uses a different projection matrix.

ED: I just checked and my HUD does indeed use a camera object set to ortho.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

@fleabay Thank you very much. I will check that out! Looks like exactly what I'm looking for

There are also more advanced versions, 2d images with depth information. The 2d object then interacts better with the 3d world.

That goes further still, with layered depth images, letting you build 3d worlds with 2d art.

It was common with early 3d hardware and devices like the Nintendo DS, letting artists build visually complex 2d art worlds rendering only small (but detailed) 3d objects with the limited graphics hardware.

But yeah, billboards for the basic forms.

@frob you put the 2d sprite on a 3deminsional plane and then it's 3d

icarusredux said:

@frob you put the 2d sprite on a 3deminsional plane and then it's 3d

@icarusredux , frob is not the person who was asking a question 2 months ago. frob was answering bigjoe's question (2 days after it was asked, 2 months ago).

-- Tom Sloper -- sloperama.com

This topic is closed to new replies.

Advertisement