Skip to main content
GameDev.net gamedev.net
🔒 Locked

2d/3d sorting

Started by fil_gamedev Jan 12, 2004 at 1:50 PM 0 replies 350+ views
Original Post
fil_gamedev
fil_gamedev
I''m looking for a method to arrange a scene of 3d and 2d objects represented by bounding cubes, for rendering. In other words I want to feed in a raw list of these objects and get back an ordered one based up on the cameras view. The problem I run into is similar to the painters algorithm for polygons, where there are several instances of ambiguity. Is there a way to determine if one object is in front of the other? Furthermore, does anyone know what is the right way of mixing 3d and 2d? sort of like FF or other adventure games? but with out specifying layers. Thanx.
RPGeezus
RPGeezus
You could use a Z-Buffer. This will solve all of your problems for 3D and 2D.

The sprites Z value would be the same across the sprite.

I would explain Z-Buffers, but many others have done a better job at that than I ever could. Check out Articles & Resources here on GameDev, or google for it.

Cheers,
Will

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.