Skip to main content
gamedev.net
🔒 Locked

Z Order

Started by michiwalter 3 replies 600+ views
Original Post
michiwalter
michiwalter
I''ve the following problem: If I render a red rectangle at z position 0 and after that a green one with z position -20, will I see the red or the green one? Thanks, Michael
Antknei
Antknei
If you are not doing any buffering, you will see the second triangle you draw, and any parts of the first that the second does not cover.
michiwalter
michiwalter
How can I avoid this?

How does buffering function?
Antknei
Antknei
What is your enviornment like? are you dealing with a moving camera or many moving objects? If it is a small scene you can preorder the polygons. If it is a massive scene with a moving camera you will most likely need to use a BSP ( check out mr-gamemaker.com ). If it is somewhere in between you can sort your polygons before drawing them. Your hardware may be able to support things like a w-buffer and a z-buffer which can relieve some of the ordering issues by keeping tracked of the "depth" of each pixel.
michiwalter
michiwalter
I wanna program a 3D Realtime Strategy Game.

Topic Locked

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

Sign in to reply to this topic.