POV-Ray : Newsgroups : povray.general : Can't rotate texture? : Can't rotate texture? Server Time
4 Nov 2024 16:07:34 EST (-0500)
  Can't rotate texture?  
From: gonzo
Date: 24 May 2004 03:49:32
Message: <40b1a90c$1@news.povray.org>
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?

Here's a sample scene, how do I make this work?

// slope pattern sample
global_settings{
 assumed_gamma 1
}

#declare Ft=1;
#declare In=Ft/12;

camera {
    location <-3,2.5,-3.5>
    look_at <0,.5,0>
    angle 60
}

light_source { <-5,15,-15> rgb 1.35 }
light_source { <-10,8,-5> rgb 1.35 }
background { rgb <.5,.6,.7> }

#declare T_Dark_Lite = texture {
    pigment {
        slope -y
        pigment_map {
            [0.00 rgb .15 ]
            [0.20 rgb .95 ]
            [0.80 rgb .95 ]
            [1.00 rgb .15 ]
        }
    }
    finish { ambient 0 diffuse .55 phong .7 phong_size 75 metallic 1 }
}

#declare W_Rad = 1.55*Ft;
#declare C_Rad = W_Rad*.65;
#declare L_Rad = .85*In;
#declare W_Wid = 2.5*In;

#declare Wheel = difference {
    cylinder { 0 <0,W_Wid,0> W_Rad }
    torus { C_Rad C_Rad*.425 scale <1,.15,1> translate y*W_Wid }
    torus { W_Rad L_Rad scale <1,2.35,1> translate y*W_Wid }
    texture { T_Dark_Lite }
}

object { Wheel  // as is, texture looks fine
     //rotate -x*90 // after rotate, texture is wrong
}
// end slope pattern sample

Thanks, RG


Post a reply to this message

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