|
|
Is there an easy way to get pov ray to mirror a texture every time it
reaches a texture boundry?
The default way pov ray repeats a texture is wrap, looks like this:
http://www.math.uni-leipzig.de/pool/tuts/SelfDXD/DirectXGraphics/texturen/wrap.gif
The way I'd need the textures repeated should look like this:
http://www.math.uni-leipzig.de/pool/tuts/SelfDXD/DirectXGraphics/texturen/mirror.gif
I've managed to simulate texture mirroring using the image_map 4 times
(original, scaled by -1 in x, scaled in y and scaled in both x and y),
combining these using gradient x and gradient y, but now I'm stuck.
I can't interpolate my image_map (color leaks around the image borders) and
scaling the image has become a nightmare.
So is there a convenient way to achive texture mirroring?
Post a reply to this message
|
|
|
|
Nils nous apporta ses lumieres en ce 2007/10/25 10:30:
> Is there an easy way to get pov ray to mirror a texture every time it
> reaches a texture boundry?
>
>
> The default way pov ray repeats a texture is wrap, looks like this:
> http://www.math.uni-leipzig.de/pool/tuts/SelfDXD/DirectXGraphics/texturen/wrap.gif
>
> The way I'd need the textures repeated should look like this:
> http://www.math.uni-leipzig.de/pool/tuts/SelfDXD/DirectXGraphics/texturen/mirror.gif
>
>
>
> I've managed to simulate texture mirroring using the image_map 4 times
> (original, scaled by -1 in x, scaled in y and scaled in both x and y),
> combining these using gradient x and gradient y, but now I'm stuck.
> I can't interpolate my image_map (color leaks around the image borders) and
> scaling the image has become a nightmare.
>
> So is there a convenient way to achive texture mirroring?
>
>
Very easy:
just use a warp{repeat x flip x}warp{repeat y flip y} scale Your_Scale
in your texture block.
The flip keyword in a repeat warp will cause the pattern to be inverted relative
to a given axis.
In this case, it will repeat every unit along both x and y axis, and each
repetition gets inverted relative to the preceding one.
You can now use interpolate, and scale after the warps.
Unless you scale it, your original image_map goes from x=0, y=0 to x=1, y=1, and
extend infinitely along the z axis.
If you scale before the warps, you need to adjust the repeat values acording to
the scaling that you used.
Please read the documentation about warp.
--
Alain
-------------------------------------------------
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
Post a reply to this message
|
|
|
|
M_a_r_c nous apporta ses lumieres en ce 2007/10/25 16:23:
> "Alain" <ele### [at] netscapenet> a écrit dans le message de news:
> 4720b9f0@news.povray.org...
>> Alain
>> -------------------------------------------------
>> f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
>
> r u sr?
> Mrc
>
>
nt me, th g ou rt ths
--
Alain
-------------------------------------------------
Fundamentalism: Shit must be born again.
Post a reply to this message
|
|