Sphere colored in 2 colours

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/03/2003 at 10:30, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.012 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
How to plot sphere with the color dependence on some function.
So I have f(x,y,z). If f(x,y,z)>0 in the point of sphere I want to be
this poin red, if f(x,y,z)<0 green, and f(x,y,z)=0 black (for
example).
Could somebody help with such porblem?
Thank you,
Nikolai

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/03/2003 at 10:08, xxxxxxxx wrote:

You could do this with a shader. Just set the color based on the ray point.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 26/03/2003 at 06:18, xxxxxxxx wrote:

Just enter this sample script into a file named "volume.cof" inside your "plugins" folder:

    
    
      
    var PLUGIN_ID = 1011472; // Unique ID
    
    
    
    
    class VolumeExample : VolumePlugin  
    {  
    public:  
      VolumeExample();  
        
      GetName();  
      GetID();  
      GetInfo(settings);  
      FillInfoData(settings,is);  
      CalcSurface(settings,render,vd);  
    };
    
    
    
    
    VolumeExample::VolumeExample() { super(); }  
    VolumeExample::GetName() { return "Volume Example"; }  
    VolumeExample::GetID() { return PLUGIN_ID; }  
    VolumeExample::GetInfo(settings) { return SHADER_SOFTSHADOW|SHADER_MIPSAT; }
    
    
    
    
    VolumeExample::CalcSurface(settings, render, vd)  
    {  
      var f = 2*vd->p.z*vd->p.z - vd->p.x*vd->p.x - vd->p.y*vd->p.y;
    
    
    
    
      if (f < -1000)   
      {  
        vd->col = vector(1,0,0);  
      }  
      else if (f > 1000)  
      {  
        vd->col = vector(0,1,0);  
      }  
      else  
      {  
        vd->col = vector(0,0,0);  
      }  
    }
    
    
    
    
    VolumeExample::FillInfoData(settings,is)  
    {  
      is->midcol   = vector(0,0,0); // Preview color  
      is->midtrans = vector(0,0,0);  
      is->midrefl  = vector(0,0,0);  
    }
    
    
    
    
    main()  
    {  
      Register(VolumeExample);  
    }

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/04/2003 at 23:08, xxxxxxxx wrote:

Dear Mikael!
Thank you very much! You help was very useful.
 
Thank you,
Nikolai