|
|
gonzo wrote:
> I created a texture to put lighter edges on an object using the slope
> pattern. Applied the texture at the origin, but when I rotate the object
> into position the texture doesn't rotate with it. Can't create the texture
> already rotated because I will have many instances of the object in
> different positions.
>
> Is this normal behavior for slope pattern? I thought that once applied a
> texture transforms with the object, no?
>
I think the slope pattern is indeed rotated, but it does not produce the
effect you expected. No matter the transform applied to it, slope always
compute the value returned with the dot product of the object's normal
and the direction specified. The problem is that the slope's direction
vector does not get transformed. And thus the color repartition after
the transformation does change. This is what is needed most of the time,
when you use slope to mimic a layer deposed on the object, such as snow
on heightfield,...
Even if you rotate the texture at its creation, the results will be the
same.
The only way I can think of, to get the effect you want, would be to
turn your whole texture statement into a macro, with the direction of
the slope as an argument. Then for each object, you could pass a
different direction to this macro, depending on the object's transform.
I have not tested it though, so I cannot assure you it works fine...
Hope this will help
--
Vincent
Post a reply to this message
|
|