POV-Ray : Newsgroups : povray.general : How to autmatically change the color of balls? : How to autmatically change the color of balls? Server Time
31 Jul 2024 22:15:38 EDT (-0400)
  How to autmatically change the color of balls?  
From: iz2517
Date: 28 Aug 2006 13:00:00
Message: <web.44f320164eb27c31ba27384d0@news.povray.org>
I use balls with various colors that should be changed frequently based on
the ball's property such as energy (ball = atom). How do I do that?

The following code reads the file consisting of three coordinates x,y,z of
atoms and draws the balls. However, I need to use a 4th variable, e.g.
energy, E and read the following string:

x,y,z,E

and then somehow use E as a feature to change the color of an atom. How do I
do that?

#while (defined(MyFile))
  #read (MyFile, MyVectX, MyVectY, MyVectZ)
  #declare MyVect = <MyVectX, MyVectY, MyVectZ>;
  sphere {MyVect, 1 texture {pigment {color rgb <a,b,c>}}}
#end
#fclose MyFile

Can I automatically define and declare three constants a,b,c?

thanks


Post a reply to this message

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