Home Products Download Order Contacts


Subject: Re: raytracing - chess board algorithm

Samuel Hornus a formulé ce dimanche :
> On Sun, 07 May 2006 18:51:26 +0200
> psr wrote:
>> Can someone explain me how to get this chess board ? (I___m not asking
>> for source code...)
> Divide your x,y plane coordinates by the width of the chess squares.
> convert the results to integers i,j.
> color white if (i+j) is odd,
> color black if (i+j) is even.

The chess board is correctly displayed ;)

I use a function IsOdd who return false or true during the ray tracing
of a plane pixel to test the coordinates.

Just a little problem when x and y are between 0 and 1, but in this
case i increment x or y when they are > 0.

Thanks S. H.


View All Messages in comp.graphics.algorithms

raytracing - chess board algorithm =>Re: raytracing - chess board algorithm =>

Re: raytracing - chess board algorithm

Copyright © 2006 WatermarkFactory.com. All Rights Reserved.