Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: Ed Federmeyer Newsgroups: scea.yaroze.programming.3d_graphics Subject: Re: Z-sorting really means *Z* sorting! Date: Sat, 19 Jul 1997 12:02:59 -0500 Organization: (no organization) Lines: 39 Message-ID: <33D0F343.2A14@charlie.cns.iit.edu> References: <33CA4E02.7487@charlie.cns.iit.edu> <33CB278F.38CF@bc.sympatico.ca> Reply-To: fedeedw@charlie.cns.iit.edu NNTP-Posting-Host: charlie.cns.iit.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0C-GZone (Win95; I) Nick Porcino wrote: > > Ed wrote: > >>>>>>> > There are cases when this > is not correct for the view, the "-Y" position *should* cause the item > to appear in front of an objects that is closer to the viewpoint > in the Z axis. > > Is there any way to adjust for this anomoly? It would be nice if > GsSortObject4() "knew" about the view and automatically compensated. > <<<<<<< > > Try creating nested OT's. You know your playing field should always be > drawn first, so stick it in it's own OT, put the OT deep, and add it to > your normal OT. > > -nick Cool! This did the trick! The problem seems to be that the Z-coordinate used to insert a polygon into the OT is the *average* Z-coordinate for all the vertices of the poly. In my case, the horizontal poly would have a lower *average* Z-coordinate than the vertical poly that was above it, and so the horizontal poly would get sorted after the vertical poly and partially cover it up. When the vertical poly moved forward enough that it's average Z-coordinate was less than the horizontal's, the vertical poly would pop into full view. The multiple OT's allow the vertical poly to "fake out" the horizontal poly! Thanks! Ed Federmeyer