POV-Ray : Newsgroups : povray.newusers : Should normal maps rotate with objects? Server Time
25 Nov 2024 09:58:17 EST (-0500)
  Should normal maps rotate with objects? (Message 1 to 4 of 4)  
From: BobK
Subject: Should normal maps rotate with objects?
Date: 19 Mar 2006 16:30:01
Message: <web.441dcc9a927b776b7aeffb6a0@news.povray.org>
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

From: Slime
Subject: Re: Should normal maps rotate with objects?
Date: 19 Mar 2006 16:43:17
Message: <441dd075$1@news.povray.org>
It should rotate with it; just make sure you put the rotation *after* the
normal block.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: BobK
Subject: Re: Should normal maps rotate with objects?
Date: 20 Mar 2006 05:50:00
Message: <web.441e8806d2bb45ca7aeffb6a0@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> It should rotate with it; just make sure you put the rotation *after* the
> normal block.
>
>  - Slime
>  [ http://www.slimeland.com/ ]

Thanks - I'd actually got confused about the coordinate system - so although
my texture was rotating it was invariant around the axis I'd rotated the
object around... Sorry for being so dumb!


Post a reply to this message

From: helge h
Subject: Re: Should normal maps rotate with objects?
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.