POV-Ray : Newsgroups : povray.animations : How to fix texture to moving part : Re: How to fix texture to moving part Server Time: 8 Mar 2021 13:17:09 GMT
  Re: How to fix texture to moving part  
From: Janc
Date: 7 Oct 2013 20:10:01
"MichaelJF" <mi-### [at] t-onlinede> wrote:
> "Janc" <jan### [at] telefonicanet> wrote:
> > Hi, all!
> > I have a code with a cylinder that tilt both sides like an inverted pendulum and
> > it is textured with rust iron.
> > The problem is that when it tilts, each picture has a diferent rust texture.
> > This is the texture used in the cylinder:
> > #declare Rust =
> > texture {
> >     pigment {
> >         granite
> >         color_map {
> >             [0.0 rgb <0.4, 0.3, 0.18>]
> >             [0.4 rgb <0.3, 0.0, 0.00>]
> >             [0.5 rgb <0.3, 0.2, 0.04>]
> >             [0.6 rgb <0.1, 0.1, 0.14>]
> >             [1.0 rgb <0.4, 0.3, 0.14>]
> >         }
> >     }
> >     finish { ambient 0.1 diffuse 0.3 }
> > }
> > cylinder{
> >     <0, 0, 0>, <0, 50, 0>, 1
> >     texture{Rust scale 10 finish{roughness 100 ambient 0.2 }
> >     rotate Ang*z // Ang = tilting degree
> > }
> > Question: Is there any code so the cylinder has the same texture in all frames?
> >
> > Thanks in advanced for your help.
>
> You have a missing bracket "}" to close the texture before the rotate I think.
> So the texture is rotated and not the cylinder what seems to be your intent.
>
> Best regards,
> Michael

Hi! Michael.
Thanks for your help, but it was a problem of copy and paste, I missed the last
}.
Any way, povray should refuse to work if there is a lost }

cylinder{
    <0, 0, 0>, <0, 50, 0>, 1
    texture{Rust scale 10 finish{roughness 100 ambient 0.2 } }
    rotate Ang*z // Ang = tilting degree
}


Post a reply to this message

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