|
|
Can I scale only image that is used in material_map leaving all used
textures unchanged ?
I.e. I have
box { ...
texture {
material_map { png "..."
texture { A }
texture { B }
}
}
}
textures A & B are i.e. bozo. And now I want to streach image to cover
entire box but WITHOUT changing scale of texture A and B I have to do :
texture { #local S=<2,3,1>;
material_map { png "..."
texture { A scale 1/S }
texture { B scale 1/S }
}
scale S
}
and if I want to use other transforms - it gets more complicated and little
uncomfortable IMHO
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|
|
|
You could declare your transform and use the transform{MyTransform
inverse}syntax in child textures. I seem to remember there is a keyword that
makes the child texture independant from the parent's modifiers, but I could
not find it. Maybe it was a MegaPov feature ?
Povingly,
Philippe
Post a reply to this message
|
|
|
|
Rafal 'Raf256' Maj wrote:
> Can I scale only image that is used in material_map leaving all used
> textures unchanged ?
You could use an image_pattern inside a pigment_pattern instead, it can
essentially do everything a material_map can, but it is more versatile.
Something like this should work:
texture {
pigment_pattern {
image_pattern { png "img.png" /*...*/ }
// Do your transformations here
}
// Given an 8-bit grayscale image, this
// simulates the material_map behaviour.
texture_map {
[0 Tex1 ]
[1/256 Tex1 ]
[1/256 Tex2 ]
[2/256 Tex2 ]
[2/256 Tex3 ]
[3/256 Tex3 ]
// ...
}
}
Post a reply to this message
|
|
|
|
Philippe Debar wrote:
> I seem to remember there is a keyword that makes the child texture
> independant from the parent's modifiers, but I could not find it.
> Maybe it was a MegaPov feature ?
Yep, the reset_children keyword. IIRC it was deprecated in favor of
pigment_pattern during the development of 3.5.
Post a reply to this message
|
|