Glad that helped.
Joe.
>Wow, thanks for the visuals! I appreciate your help on the ball size based on the Z axis. Like I had stated, I wasn't even to that point yet as I was trying to figure out a formula for converting the ball's actual X,Y,Z coordinates (i.e. inches) with the SCREEN coordinates of X and Y (i.e. pixels).
>
>A friend of mine gave me some insight with the following code. This is assuming a room like your image, in an 800x600 screen resolution, but would work on other resolutions as well.
>
>Note this is only for the Y location of the ball and does not take into account gravity, friction, etc.
>
>parameters xreal,yreal,zreal
>courtdeepreal=479
>courthighreal=239
>courtwidereal=239
>backwallheighthinpixels=200
>screenheightinpixels=599
>heightbase=(courtdeepreal-zreal)*(backwallheighthinpixels/courtdeepreal)
>updownrange=screenheightinpixels-(2*heightbase)
>pixely=screenheightinpixels - ( heightbase + ( updownrange * (1-(yreal/courthighreal)) ) )
>return pixely
>
>Thanks again!
>-Kevin
~Joe Johnston USA
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams