POV-Ray : Newsgroups : povray.news-submissions : change color of the input sphere : Re: change color of the input sphere Server Time
25 Jul 2021 14:25:32 EDT (-0400)
  Re: change color of the input sphere  
From: Stephen
Date: 9 Nov 2013 07:04:18
Message: <527e24c2$1@news.povray.org>
On 09/11/2013 12:09 AM, yinfunglo5063 wrote:
> He everyone,
>
> I am a new user on povray.
...
> How can I achieve this?
>
> Thanks so much!!!!
>
>

Hi yinfunglo5063 and welcome.

You have posted in the wrong newsgroup and your question will probably 
not be seen by those who could help you. Try povray.newusers

There are several ways of doing what you want. If you use a variable for 
the radius, try using the #switch directive:

#declare Rad_Val = 10.00 ; // Your radius variable

sphere {
0.0, Rad_Val

texture{

#switch (Rad_Val)
         #case( 10 )
                 _texture_1
               #break
         #case( 15  )
                 _texture_2
               #break
          #case( 20 )
                 _texture_3
               #break
          #else
                 _texture_0
                 #break
#end
           }
}

Where _texture_0 to _texture_4 have been declared earlier.



-- 
Regards
     Stephen


Post a reply to this message

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