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

Greg Ward gregoryjward at gmail.com
Wed May 7 08:42:52 PDT 2008


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

> From: "Marija Velickovic" <maricanis at gmail.com>
> Date: May 7, 2008 3:32:56 AM PDT
>
> Hi,
>
> I have related question.
> If I define some complex material (with patterns, textures or even
> material mixture), and I want to apply it on various surfaces, how can
> I adjust material orientation to fit the final surface.
>
> For example my complex material is defined in ZX plane, and my surface
> is in some other plane.
> I calculated needed rotation and translation parameters for the
> material but how can I apply them to material and then to an object.
>
> #simple plastic materials mat1, mat2 and mat3 are defined previously
>
> #Vertical bands
> #bands.cal is my functional file
> #-s mat1 + mat2 in meters
> # A1 = mat1/(mat1+mat2)
> #30cm mat1|60cm mat2
> void mixfunc vert_bands
> 6   mat1 mat2 band_x ./bands.cal -s 0.9
> 0
> 1      0.33
>
> #one additional mat3 band each 3 mat1 and mat2 bands
> #300cm vert_bands|60cm mat3
> void mixfunc bands3
> 6   vert_bands mat3  band_x ./bands.cal -s 3.6
> 0
> 1      0.8333
>
> Now I want to apply bands3 material to some surface like this:
> mat1 polygon cloisons_4D1C.0.1
> 0
> 0
> 18	4445.9871	2212.8005	1035
> 	4421.9526	2166.5971	1035
> 	4434.1345	2160.294	1035
> 	4431.804	2155.7899	1035
> 	4415.0455	2164.5516	1035
> 	4441.6689	2215.0555	1035
>
> I calculated rotation and translation parameters:
>  -rx 0.000000 -ry -0.000000 -rz -117.482955 -t 4421.952600 2166.597100
> 1035.000000
>
> So I need to use this transformation values on material to adjust
> material orientation to the created surface.
> *I can use transformations both on vert_band and bands3 material, but
> then I would change my basic material and for all other surfaces I
> have to redefine the material completely with new transformation
> parameters.
>
> *If I add transformations only to bands3 material, then bands made of
> mat3 are rotated, but bands made of mat1 and mat2 stay in the same
> orientation as before.
>
> *My idea is to define complete complex material in ZX plane, and then
> just adjust final material as needed for each surface.
> I tried something like this:
> void mixfunc mat1
> 14 bands3 void 1 .   -rx 0.000000 -ry -0.000000 -rz -117.482955 -t
> 4421.952600 2166.597100 1035.000000
> 0
> 0
> but it didn't work. Final material look the same as original bands3  
> material.
>
> I'm not sure if I was clear enough, but if someone understands my
> question and have an answer that would be great.
>
> Marija
>



More information about the Radiance-general mailing list