POV-Ray : Newsgroups : povray.newusers : Should normal maps rotate with objects? : Re: Should normal maps rotate with objects? Server Time
29 Jul 2024 10:26:12 EDT (-0400)
  Re: Should normal maps rotate with objects?  
From: helge h
Date: 20 Mar 2006 08:55:00
Message: <web.441eb30fd2bb45ca1c6902970@news.povray.org>
"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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.