POV-Ray : Newsgroups : povray.newusers : Using a disc for plantary rings Server Time
24 Nov 2024 04:17:40 EST (-0500)
  Using a disc for plantary rings (Message 1 to 2 of 2)  
From: TJ
Subject: Using a disc for plantary rings
Date: 15 Jul 2010 23:15:00
Message: <web.4c3fce8a40cb4ea07606f470@news.povray.org>
Hi guys, I know there's probably a thread out there, but I've tried many
different search terms and can't find the answer I am looking for.
I can't seem to figure out how to get the color map to go around the disc, so to
speak, like normal rings would.
I'm sure I'm missing something silly, but I've been looking on the newsgroups
and in the documentation for a couple of hours, can't seem to find anything that
would do what I want.

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]
                        }
                }
        }
}


Post a reply to this message

From: clipka
Subject: Re: Using a disc for plantary rings
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.