[Radiance-general] applied material to all faces of a genbox

Marija Velickovic maricanis at gmail.com
Thu May 8 04:25:23 PDT 2008


Thanks Greg,

Your explanation solves my problem, and now I have another related
question, of course :)

If my material is defined in some plane, for example ZX, and I have a
surface in some other plane, how can I calculate needed
transformations (rotations), to place the material correctly.

I wrote the script and used the code from replmarks.c but it seems I'm
missing something important. Calculated rotations give good results
for some surfaces and bad for others.

So question is how should I calculate 3 rotation angles for -rx -ry
and -rz, if I have:
* starting right-oriented coordinate system defined with vectors
x0,y0,z0  (plane where material is defined) and
* surface coordinate system defined with vectors x1,y1,z1 (calculated
from tree points on surface plane and normal)

Thanks again,
Marija.



On Wed, May 7, 2008 at 5:42 PM, Greg Ward <gregoryjward at gmail.com> wrote:
> Hello Marija,
>
>  Without address your problem specifically, let me suggest three approaches
> to handling material orientations:
>
>  1) If your material definition cares only about orientation, and not
> position, and your surfaces tend to take on only a few principal
> orientations (such as the three coordinate planes), then create one material
> definition for each principal orientation.  This method is used for the
> "woodpat.cal" file, for example.
>
>  2) If you have many orientations and/or your material definition depends
> also on position, then include your material in a file with your canonical
> surface, then transform the two together using xform.  The surface will be
> moved, and the transformation added appropriately to your material
> definition.  E.g:
>
>         !xform [xf args] mat+obj.rad
>
>  3) If the above technique does not work because you are applying your
> material to different objects each time, then you can put the material
> definition in a file by itself and include it with your transform, along
> with the object file.  E.g:
>
>         !xform [xf args] matdef.mat objdef.rad
>
>  There is no need to worry about the material name being the same but
> meaning something different each time, as the most recent definition in a
> stream is always the one used.
>
>  Does this help at all, or am I missing your point?
>
>  -Greg
>



More information about the Radiance-general mailing list