Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: negative z ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 8 Topic 635 of 680
Post > Topic >>

Re: negative z coordinates

by Tom Plunket <gamedev@[EMAIL PROTECTED] > Aug 5, 2007 at 01:08 AM

bob wrote:

> I was just wondering how you should handle negative z coordinates when
> converting a 3d point to 2d. Although they are outside the viewing
> frustum, I think you still must convert them to 2d when you are
> rasterizing a triangle that intersects the viewing frustum but happens
> to have a coordinate with a negative z.

You do have to handle them, but the projection isn't what you want
because you'll quickly end up with the polygons around the camera
covering up the screen because when Z gets close to zero, the divide
(1/z) gets huge, and you end up with gargantuan polygons.

What you need to is figure out where polygons intersect your near clip
plane (as opposed to simply going negative) and then "scissor" them.  My
Googling skills seem inadequate for this, but basically what you need to
do is chop the triangle at the near plane, which will often yield a
trapezoid that you may have to turn into two triangles.  Anything that
interpolates across your triangle (color, texture coordinates, etc.)
needs to be recomputed for those new vertices, obviously.  ...and then
anything that's left behind the clip plane (including vertices that have
a negative Z) are discarded.


-tom!

--
 




 8 Posts in Topic:
negative z coordinates
bob@[EMAIL PROTECTED]   2007-07-31 01:58:39 
Re: negative z coordinates
Tom Plunket <gamedev@[  2007-08-05 01:08:42 
Re: negative z coordinates
"Jim Langston"   2007-08-13 17:10:30 
Re: negative z coordinates
Tom Plunket <gamedev@[  2007-08-16 16:29:45 
Re: negative z coordinates
"Jim Langston"   2007-08-19 01:23:11 
Re: negative z coordinates
Tom Plunket <gamedev@[  2007-08-28 18:08:25 
Re: negative z coordinates
"Jim Langston"   2007-08-31 17:41:12 
Re: negative z coordinates
Tom Plunket <gamedev@[  2007-09-01 22:21:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 19:30:26 CDT 2008.