0
\$\begingroup\$

I am creating a 2D (2.5D) game using OpenGL and orthographic projection.

It is simple to have relatively flat objects, e.g. characters. I simply use a quad with a texture of the character and move that about.

However, what is the best way to draw big objects that have depth, e.g. a big house? Do I use one quad with a three dimensional looking represantation of the house on it, or do I use multiple quads (e.g. front, side, top)?

I prefer using one quad with a three dimensional looking texture on it. What are the drawbacks to this approach?

\$\endgroup\$
  • \$\begingroup\$ This is very vague. You use whatever works best for you. \$\endgroup\$ – Kromster Jul 1 '15 at 18:59
  • \$\begingroup\$ Yeah, you are right. I prefer the option with one quad as it is much easier to draw the representation (create the pixel house). What are the drawbacks to that approach? \$\endgroup\$ – schemar Jul 1 '15 at 19:00
1
\$\begingroup\$

Having done both, I can say that using a single quad is best in circumstances where none of your larger objects take up more than one grid square and/or are square/cube-shaped. Otherwise, you will eventually run into Z-sorting issues.

The multiple-quad solution was the best one that I found to deal with that particular situation. IE, if you had larger, irregular-shaped objects it was best to slice them into quads that represented each grid square that they occupied.

It ultimately depends on your engine; the former is the easier, but it won't work in all situations. The latter will, but may be overkill for the type of game you're doing.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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