## Just fo fun...

### Just fo fun...

This is fun for beginners
like me...it reminds me of the
kid's Spirograph toy, and it
helps get acquinted with
color maps!
POV
//------------------------------------------------------------------
#include "colors.inc"

#declare Pigm = pigment {
spiral2 5
color_map {
[0.00 color rgb <1, 0.25, 0.25>]
[0.33 color rgb <1, 1, 0.25>]
[0.50 color rgb <0.25, 1, 0.25>]
[0.66 color rgb <0.25, 0.25, 1>]
[1.00 color rgb <1, 0.25, 0.25>]
}
}
camera {
location <0, 0, -25>
look_at <0, 0, 0>

Quote:}

light_source
{
<0,0,-5>
color rgb <1,1,1>
spotlight
translate <40, 80, -40>
point_at <0, 0, 0>
tightness 50
falloff 8
Quote:}

plane {z, 15 texture  {
Pigm scale 5 finish{
reflection .05
ambient .8
diffuse 0.7
phong 1.0 phong_size 90}

scale <2.0, 2.0, 2.0>
translate <9.5, 0.0, 4.25>
}

Quote:}

//------------------------------------------------------------------

Hey Guys,

I'm trying to implement a box filter line drawing algorithm and i'm
having some difficulties. basically my problem is with finding the
area under a 1-pixel wide line. usually in the worst case it cover 3
adjacent pixels at given x coordinate that is on the line segment.

i'm wondering if there is a general formula based on the angle the
line intersects the pixels giving the area.

maybe i'm way off track here.. can anyone help?

another thought i had was to draw line segments between all the
intersection points of the 1-pixel wide line and a given x value..
this would split up the area into triangles.. and then using the cross
product to calculate the areas and add them up,, but this seems to me
a wasteful way of doing it..

any input would be greatly appreciated..

thanks