|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
I'am trying to create "box mapped" texture using slope_map, it looks like
...
#declare _ArMa_pBM_compTable = array [7]
#declare _ArMa_pBM_compTable[1] = array [6] { 0, 0, 0, 0, 0, 0 }
#declare _ArMa_pBM_compTable[2] = array [6] { 0, 0, 0, 0, 1, 1 }
#declare _ArMa_pBM_compTable[3] = array [6] { 0, 1, 0, 1, 2, 2 }
#declare _ArMa_pBM_compTable[6] = array [6] { 0, 1, 2, 3, 4, 5 }
#macro _ArMa_pBM_comp(From, Num)
From[ _ArMa_pBM_compTable[ dimension_size(From, 1) ][ Num ] ]
#end
#macro ArMa_pBoxMap(Size, Pigments)
#local _tmpPig0 = pigment {
slope x
pigment_map {
[0.5 _ArMa_pBM_comp(Pigments, 3) rotate <0, 90, 0> translate
<0, 0, Size.z>]
[0.5 _ArMa_pBM_comp(Pigments, 1) rotate <0, -90, 0>]
}
}
#local _tmpPig1 = pigment {
slope z
pigment_map {
[0.25 _ArMa_pBM_comp(Pigments, 0)]
[0.25 _tmpPig0]
[0.75 _tmpPig0]
[0.75 _ArMa_pBM_comp(Pigments, 2) rotate <0, 180, 0> translate
<Size.x, 0, 0>]
}
}
pigment {
slope y
pigment_map {
[0.25 _ArMa_pBM_comp(Pigments, 4) rotate <-90, 0, 0> translate
<0, 0, Size.z>]
[0.25 _tmpPig1]
[0.75 _tmpPig1]
[0.75 _ArMa_pBM_comp(Pigments, 5) rotate <90, 0, 0>]
}
}
#end
...
#declare Obj = box {
<0, 0, 0>, <1, 1, 1>
texture {
ArMa_pBoxMap(<1, 1, 1>, array [6] {
pigment {color rgb <1, 0, 0>}
pigment {color rgb <0, 1, 0>}
pigment {color rgb <0, 0, 1>}
pigment {color rgb <1, 1, 0>}
pigment {color rgb <1, 0, 1>}
pigment {color rgb <0, 1, 1>}
})
}
translate <-0.5, -0.5, -0.5>
}
union {
object {Obj translate <-1.5, 0, 0>}
object {Obj rotate <0, 45, 0>}
object {Obj rotate <0, 90, 0> translate <1.5, 0, 0>}
translate <0, 0.5, 0>
}
...
It partially works ... correctly for the first, unrotated cube. Second
and third cubes looks like they are textured after transformation. It
seems, that slope_map pattern is not affected by texture or object
transformation...
Does anybody know, how to fix this?
Regards
Vaclav
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Vaclav Cermak nous apporta ses lumieres en ce 2006-12-11 09:18:
> Hi,
> I'am trying to create "box mapped" texture using slope_map, it looks like
> ...
> #declare _ArMa_pBM_compTable = array [7]
> #declare _ArMa_pBM_compTable[1] = array [6] { 0, 0, 0, 0, 0, 0 }
> #declare _ArMa_pBM_compTable[2] = array [6] { 0, 0, 0, 0, 1, 1 }
> #declare _ArMa_pBM_compTable[3] = array [6] { 0, 1, 0, 1, 2, 2 }
> #declare _ArMa_pBM_compTable[6] = array [6] { 0, 1, 2, 3, 4, 5 }
> #macro _ArMa_pBM_comp(From, Num)
> From[ _ArMa_pBM_compTable[ dimension_size(From, 1) ][ Num ] ]
> #end
> #macro ArMa_pBoxMap(Size, Pigments)
> #local _tmpPig0 = pigment {
> slope x
> pigment_map {
> [0.5 _ArMa_pBM_comp(Pigments, 3) rotate <0, 90, 0> translate <0,
> 0, Size.z>]
> [0.5 _ArMa_pBM_comp(Pigments, 1) rotate <0, -90, 0>]
> }
> }
> #local _tmpPig1 = pigment {
> slope z
> pigment_map {
> [0.25 _ArMa_pBM_comp(Pigments, 0)]
> [0.25 _tmpPig0]
> [0.75 _tmpPig0]
> [0.75 _ArMa_pBM_comp(Pigments, 2) rotate <0, 180, 0> translate
> <Size.x, 0, 0>]
> }
> }
> pigment {
> slope y
> pigment_map {
> [0.25 _ArMa_pBM_comp(Pigments, 4) rotate <-90, 0, 0> translate
> <0, 0, Size.z>]
> [0.25 _tmpPig1]
> [0.75 _tmpPig1]
> [0.75 _ArMa_pBM_comp(Pigments, 5) rotate <90, 0, 0>]
> }
> }
> #end
> ...
> #declare Obj = box {
> <0, 0, 0>, <1, 1, 1>
> texture {
> ArMa_pBoxMap(<1, 1, 1>, array [6] {
> pigment {color rgb <1, 0, 0>}
> pigment {color rgb <0, 1, 0>}
> pigment {color rgb <0, 0, 1>}
> pigment {color rgb <1, 1, 0>}
> pigment {color rgb <1, 0, 1>}
> pigment {color rgb <0, 1, 1>}
> })
> }
> translate <-0.5, -0.5, -0.5>
> }
> union {
> object {Obj translate <-1.5, 0, 0>}
> object {Obj rotate <0, 45, 0>}
> object {Obj rotate <0, 90, 0> translate <1.5, 0, 0>}
> translate <0, 0.5, 0>
> }
> ...
> It partially works ... correctly for the first, unrotated cube. Second
> and third cubes looks like they are textured after transformation. It
> seems, that slope_map pattern is not affected by texture or object
> transformation...
> Does anybody know, how to fix this?
> Regards
> Vaclav
Try rotating the slope vectors to match that of your object.
--
Alain
-------------------------------------------------
To compel a man to furnish funds for the propagation of ideas he disbelieves
and abhors is sinful and tyrannical.
Thomas Jefferson
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Vaclav Cermak <dis### [at] disnelcom> wrote:
> Hi,
>
> I'am trying to create "box mapped" texture using slope_map, it looks like
[...]
Try applying the texture *after* the transformation, see if that makes any
difference. I think because the slope map *depends* on surface angles, it
will not necessarily work the way you might expect before/after
transformation:
#declare Obj = box {
<0, 0, 0>, <1, 1, 1>
translate <-0.5, -0.5, -0.5>
}
#declare Tex =
texture {
ArMa_pBoxMap(<1, 1, 1>, array [6] {
pigment {color rgb <1, 0, 0>}
pigment {color rgb <0, 1, 0>}
pigment {color rgb <0, 0, 1>}
pigment {color rgb <1, 1, 0>}
pigment {color rgb <1, 0, 1>}
pigment {color rgb <0, 1, 1>}
})
}
union {
object {Obj translate <-1.5, 0, 0> texture { Tex } }
object {Obj rotate <0, 45, 0> texture { Tex } }
object {Obj rotate <0, 90, 0> translate <1.5, 0, 0> texture { Tex } }
translate <0, 0.5, 0>
}
.... The other problem could be that (iirc) sometimes the texture of the
first object in a union can override that of other objects, unless they
have their own individual textures defined. Either way the above code
should fix it.
Pete
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|