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:32:37 GMT
  Re: How to fix texture to moving part  
From: Janc
Date: 8 Oct 2013 11:00:01
"MichaelJF" <mi-### [at] t-onlinede> wrote:
> "Janc" <jan### [at] telefonicanet> wrote:
>
> > 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 }
>
> Usually it does. But in some cases the placement of the brackets determines the
> structure the transforms are to be applied. Textures can be transformed as well
> as objects. So if you have a transform (like rotate, translate or scale or the
> totally confusing matrix transforms) within a texture, it will be applied to the
> texture and not to the object which the texture is to be applied.
>
> >
> > cylinder{
> >     <0, 0, 0>, <0, 50, 0>, 1
> >     texture{Rust scale 10 finish{roughness 100 ambient 0.2 } }
> >     rotate Ang*z // Ang = tilting degree
> > }
>
> In this case the rotation is applied to the object (the cylinder) and not to the
> texture.
>
> Best regards,
> Michael

Hi! Michael.

I tried with various position of "rotate<x,y,z>" but it never seem to rotate my
Rust texture.

#declare MyRust =
    texture{ Rust
        normal { agate 1.5 scale 0.25 }
        finish { phong 0.1  }
        scale 0.1
    }

#declare Mastil =
    union{
        cone {
            <0, 0, 0>, radio_inferior_mastil   // Centro y radio inferior.
            <0, 320, 0>, radio_superior_mastil    // Centro y radio superior.
            open
        }
        cylinder{ // Lower end closer.
            <0, -.5, 0>, <0, .5, 0>, radio_inferior_mastil
        }
    }

Test 1
object{
    Mastil
    #local Ang_Mastil = -( ((ClockZ-Fase_2)*90)/(Fase_3-Fase_2) );
    rotate <0, 0, Ang_Mastil> // OK
    texture{ MyRust rotate <0, 0, Ang_Mastil> } // <<<<<< it seems not rotate.
}

Test 2
object{
    Mastil
    #local Ang_Mastil = -( ((ClockZ-Fase_2)*90)/(Fase_3-Fase_2) );
    texture{ MyRust } // <<<<<< it seems not rotate.
    rotate <0, 0, Ang_Mastil>
}


I upload a gif with the result at:
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.5253e42b5b3e3e64bbbff5b50@news.povray.org%3E/

There you can see how texture change each frame.

Regards.


Post a reply to this message

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