|
|
If I apply a normal map to an object (in fact an bump map that I have
produced myself) and then rotate the object should the normal map rotate
with the object? This is what I expected to happen, but isn't the result I
get... The documentation implies that scaling an object scales the normal
map, so I assumed that rotation and translation should also act on normal
maps. Any feedback gratefully received - maybe I've just made a beginner's
mistake...
Post a reply to this message
|
|
|
|
"Slime" <fak### [at] emailaddress> wrote:
> It should rotate with it; just make sure you put the rotation *after* the
> normal block.
There is an exception; the slope pattern (a bug?). If you want the texture
to follow the rotations, you must do something like this:
--
#local R_angle = <-30,20,45>; // the complete rotation angle
#local S_vector = vrotate ( <0,1,0>, R_angle ); // the vector points up
first, then is rotated
#local MyTexture = texture {
pigment {
slope S_vector // the slope pattern can only be rotated here...
color_map {
[ 0.0 color rgb <0.0, 0.5, 1.0> ]
[ 0.5 color rgb <0.0, 0.5, 1.0> ]
[ 0.5 color rgb <1.0, 0.5, 0.0> ]
[ 1.0 color rgb <1.0, 0.5, 0.0> ]
}
// and not here or later
}
}
#local MyObject = sphere { 0, 1 scale <2,1,1> texture { MyTexture } }
// ---
object { MyObject rotate R_angle }
--
I discovered this when I tried to use an image map projected from three
directions (from top, front and right), controlling it with the slope
pattern. I ended up using garadient patterns then, but later I figured out
the trick above.
H
Post a reply to this message
|
|