POV-Ray : Newsgroups : povray.beta-test : Pattern alignment : Re: Pattern alignment Server Time
29 Jul 2024 00:28:53 EDT (-0400)
  Re: Pattern alignment  
From: Bob Hughes
Date: 20 Feb 2006 05:08:07
Message: <43f99507$1@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message 
news:43f976fd$1@news.povray.org...
>> will render differently in 3.7 vs 3.6
>
> I assume this is related to the fact that the checker/cells patterns were
> internally translated by -.001 or something like that to avoid ugliness
> issues on unit-aligned planar surfaces. Out of curiosity, how was this
> changed without bring the problem back?

I wasn't sure what this was about until reading your reply, almost wrote 
here earlier to ask why Chris thought this was a potential problem but 
thought I would wait and see if I figured it out, so am glad I did-- well, 
you did for me.

Now I've tried this using plane, box and disc with either checker or 
gradient x to see how each is affected. You might want to take a look at the 
script below.

The disc is still affected by the gradient pattern being at 0, although I 
think you and others already knew that. I have a vague memory of this being 
discussed even during the 3.7 betas, just not absolutely sure it was. 
Hmmmmm... was it that some object surfaces are now being moved in lieu of 
patterns and some not? Must be something I didn't retain in my personal POV 
knowledge base (in-brain, that is).  ;)

The box is a curiosity to me because it isn't the x direction being affected 
by the scaling, it's the -z side seen changing instead. Maybe this is of 
some importance anyhow.

/* BEGIN */

#version 3.6;

// use checker pattern, or use gradient x
#declare Check = yes;

// scale pattern along x by 1000, or not
#declare Scale = yes;

background { colour rgb 0.5 }

camera
{
  location  <2.0, 2.0, -5.0>
  look_at   <0.0, 0.0,  0.0>
  right     x*image_width/image_height
}

plane // semitransparent so disc can be seen below
{
  y,0
  pigment {
    #if (Check=yes)
    checker color rgb 1 transmit 2/3 color rgb 0 transmit 2/3
    #else
    gradient x color_map {[0 color rgb 1 transmit 2/3][1 color rgb 0 
transmit 2/3]}
    #end
    #if (Scale=yes)
    scale <1000, 1, 1>
    #end
    }
  finish { ambient 0.75 }
}

box
{
  <-1,0,-1>,<0,2,1> // left side aligns with plane's pattern when scaled
  pigment {
    #if (Check=yes)
    checker color rgb 1 color rgb 0
    #else
    gradient x color_map {[0 color rgb 1][1 color rgb 0]}
    #end
    #if (Scale=yes)
    scale <1000, 1, 1>
    #end
    }
  finish { ambient 0.75 }
}

disc
{
  <0,-1,0>,<1,0,0>,1
  pigment {
    #if (Check=yes)
    checker color rgb 1 color rgb 0
    #else // gradient causes surface alignment artifacts
    gradient x color_map {[0 color rgb 1][1 color rgb 0]}
    #end
    #if (Scale=yes)
    scale <1000, 1, 1>
    #end
    }
  finish { ambient 0.75 }
}

/* END */


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.