# Pattern on tilted surfaces

first I want to thank Greg and Mark for their helpful hints concerning
my soft shadow problem. Both ways worked very well (using jitter = 0.7
or sligthly disslocated suns).
Now I'm facing a new problem. I want to simulatate a window with a
pattern for sun protection. In the archive I found something like the
following:

void plastic-10 pattern_10
0
0
5 .1 . 1 .1 .03 .02

void mixfunc pattern_round
4 pattern_10 void result r_hole.cal
0
2 .003 .002

This is the r_hole.cal file:

{
square holes
A1 = length
A2 = distance

}

a=A1+A2;
result=if(zhole,0,1);
next_dotx= a /2-mod(U,a);
next_doty= a /2-mod(V,a);
zhole=if(sq(arg(1)/2)-sq(next_dotx)-sq(next_doty),1,0);

pattern_round polygon window_with_pattern
0
0
12
......

This functions works properly for vertical and horizontal surfaces. For
tilted surfaces the pattern is getting smaller all the more you tilt a
vertical to a horizontal surface. I tried to play around the r_hole.cal
file but I was not able to figure out, what screw I had to rotate.
Hopefully, there is someone out there who can give me a hand.

Thanks and best regards,
Kai

···

This is the r_hole.cal file:

{
square holes
A1 = length
A2 = distance

}

a=A1+A2;
result=if(zhole,0,1);
next_dotx= a /2-mod(U,a);
next_doty= a /2-mod(V,a);
zhole=if(sq(arg(1)/2)-sq(next_dotx)-sq(next_doty),1,0);

[...]

This functions works properly for vertical and horizontal surfaces. For tilted surfaces the pattern is getting smaller all the more you tilt a vertical to a horizontal surface. I tried to play around the r_hole.cal file but I was not able to figure out, what screw I had to rotate. Hopefully, there is someone out there who can give me a hand.

I think the simplest way is to keep the pattern material definition and the
window (vertical or horizontal) polygon in one file and then move and rotate
this file into place with xform:

!xform -rx 20 -t .... window_and_pattern.rad
!xform -rx 30 -rz 45 -t ... window_and_pattern.rad

There are some .cal files out there that allow a rotation argument but you
have to define every angle of the glazing as a separate pattern.

Thomas

···

On 27 Mar 2008, at 11:05, Kai Babetzki wrote: