POV-Ray : Newsgroups : povray.newusers : Using a disc for plantary rings : Re: Using a disc for plantary rings Server Time
5 Jul 2024 03:48:59 EDT (-0400)
  Re: Using a disc for plantary rings  
From: clipka
Date: 16 Jul 2010 05:22:14
Message: <4c4024c6$1@news.povray.org>
Am 16.07.2010 05:14, schrieb TJ:

> This is my code for the ring(s):
>
> disc
> {
>          <0, 40, 0>,
>          <-10, 40, -10>,
>          35, 30
>          texture
>          {
>                  pigment
>                  {
>                          onion
>                          color_map
>                          {
>                                  [0.2 rgb<1, 0, 0>  transmit 0.8]
>                                  [0.4 rgb<0, 0, 1>  transmit 0.3]
>                                  [0.6 rgb<0, 1, 0>  transmit 0.3]
>                          }
>                  }
>          }
> }

POV-Ray doesn't automatically "center" textures on a particular object, 
i.e. the center of your onion pigment is still at <0,0,0>, while the 
center of your disc is at <0,40,0>.

To compensate for this, you either have to (A) translate the texture 
separately, or - which I find easier - (B) initially place the object at 
the origin and then translate it around together with its texture:

(A)

disc {
     <0,40,0>,
     <-10,40,-10>,
     35,30
     texture {
         ...
         translate <0,40,0>
     }
}

(B)

disc {
     <0,0,0>,
     <-10,40,-10>,
     35,30
     texture {
         ...
     }
     translate <0,40,0>
}


Post a reply to this message

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