Dark Bit Factory & Gravity

PROGRAMMING => General coding questions => Topic started by: spitfire on February 03, 2014

Title: Understanding Chris Hecker
Post by: spitfire on February 03, 2014
I'm trying to understand Chris heckers texture mapping articles from eons ago ( http://chrishecker.com/Miscellaneous_Technical_Articles (http://chrishecker.com/Miscellaneous_Technical_Articles)).
But I keep getting stuck.

On page 18 of the first article he starts trying to prove a direct relationship between the eventual x co-ordinate on the screen and its originating z co-ordinate in world space (which could be anywhere on some arbitrary model). That doesn't make sense, there isn't any relationship between the two. Or am I miss interpreting it?

You can't multiply every x on the screen by some simple linear function to get the original z of the model.
Title: Re: Understanding Chris Hecker
Post by: Canopy on February 03, 2014
he's only talking about that from calculating the final point via the perspective projection transform?
Title: Re: Understanding Chris Hecker
Post by: hellfire on February 03, 2014
he starts trying to prove a direct relationship between the eventual x co-ordinate on the screen and its originating z co-ordinate in world space
All coordinates are in camera space.
There's a linear relationship of x,y,z because it's a triangle.
So there's one z coordinate for every pair of x,y.
A triangle is drawn top to bottom. In each scanline only x changes and y keeps constant.
So to say there's one z for every x (of a scanline).
Once (x,y) is 2d-projected, the linear relationship of (x,y) -> z breaks.
Instead, 1/z is linear across the projected triangle because it z gets the same transformation as x & y.