POV-Ray : Newsgroups : povray.text.scene-files : Isosurface test Server Time
1 Jul 2024 03:21:35 EDT (-0400)
  Isosurface test (Message 1 to 2 of 2)  
From: R  Suzuki
Subject: Isosurface test
Date: 4 Jan 2002 10:21:46
Message: <3c35c88a@news.povray.org>
// Persistence of Vision Ray Tracer Scene Description File
// File: 020103c.pov
// Vers: 3.5 beta 9
// Desc: Isosurface test scene file
//  Time for trace: for 640x480 NoAA on 600MHz/Celeron/Win98
//                  F1=30,F2=30,F3=20 : 96sec (2nd run)
//                  F1=30,F2=30,F3=25 : Out of Memory 
// Date: 1/3/2002
// Auth: Ryoichi Suzuki  < r-s### [at] aistgojp >

#version 3.5;
#include "functions.inc" 

#declare Radiosity=off;    
#declare ISO= on;
#declare AREA_LIGHT= off;
#declare FOCAL_BLUR = off; 
#declare Blur_Smpl =5;

#declare F1=30;
#declare F2=30;
#declare F3=25; 

global_settings {
  #if (Radiosity)
    radiosity {
      pretrace_start 0.08 pretrace_end   0.02    
      count 5  nearest_count 3 low_error_factor .5  minimum_reuse 0.05    
      adc_bailout 0.01/2  normal off
    }
  #end
}

camera {
  location  <0, 0, -6.5>  direction 0.9*z right x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
#if (FOCAL_BLUR)
  aperture 0.17  blur_samples Blur_Smpl        
  focal_point <0.,0,0.4>  confidence 0.95 variance 1/200            
#end
}

light_source { <-0,0,-40>  color rgb 1 
  #if (AREA_LIGHT)
    area_light <2.5, 0, 0>, <0, 2.5,0>, 2, 2  adaptive 1  jitter      
  #end
  fade_distance 30 fade_power 2}

light_source { <0,36,-40>  color rgb <1.0,0.9,0.8> 
  #if (AREA_LIGHT)
    area_light <2, 0, 0>, <0, 2,0>, 2, 2  adaptive 1  jitter      
  #end
  fade_distance 30 fade_power 2}

sky_sphere { pigment { gradient y 
 color_map{[.0 rgb<.35,.3,.2>] [.6 rgb<.40,.5,.65>][1. rgb<.35,.3,.2>]} }}

#macro SPHERE11(P1,P2)
#if (ISO & (P2>0.1))
  isosurface {
    function{f_sphere(x,y*0.7,z,1)
             +sin(f_th(x,0,z)*P1+f_r(x,0,z)*4)*0.15*f_r(x,0,z)+0.2}  
    contained_by{sphere{0,1}} 
    max_gradient 0.6+P1*0.1 accuracy 0.01               
//  evaluate off
#else
  sphere {0,1-P2*ISO  
#end
     texture{ pigment{ 
       function{(cos(f_th(x,0,z)*P1+f_r(x,0,z)*4)*f_r(x,0,z)+1.5)/2.5
                *f_r(x,0,z)}
       color_map{[0 rgb <0.5,0.25,0.1>] 
                 [.25 rgb <0.85,0.7,0.5>][.5 rgb 1][1 rgb 1]}}
  #if (Radiosity)
       finish{ambient 0.2}
  #else
       finish{ambient 0.35}
  #end
     }
     scale <1,0.12,1> 
  }
#end

#declare S1=0.6;               

#declare R1 = seed(1);
#declare N3=0;
#while (N3<F3)
  #declare N2=0;
  #while (N2<F2)
    #declare N1=0;
    #while (N1<F1) 
      #if (rand(R1)>0.6)
        object{
          SPHERE11(5+int(rand(R1)*10), rand(R1)) 
          rotate <rand(R1)*360,rand(R1)*360,rand(R1)*360> scale S1 
          translate <N1-F1/2+rand(R1)*0.4,N2-F2/2+rand(R1)*0.4,N3> }
      #end
      #declare N1=N1+1;
    #end
    #declare N2=N2+1;
  #end
  #debug concat("N3:",str(N3,4,0),"\n")
  #declare N3=N3+1;
#end


Post a reply to this message

From: R  Suzuki
Subject: Re: Isosurface test (MegaPOV version)
Date: 5 Jan 2002 10:54:44
Message: <3c3721c4$1@news.povray.org>
This is the scene file for MegaPOV.

// Persistence of Vision Ray Tracer Scene Description File
// File: 020103c_m.pov
// Vers: 3.1g MegaAPOV (and 3.5 beta 9)
// Desc: Isosurface test 
//  Time for trace: 59sec on for 640x480 NoAA on 600MHz/Celeron/Win98
//                  F1=30,F2=30,F3=20  (MegaPOV)
// Date: 1/3/2002
// Auth: Ryoichi Suzuki  < r-s### [at] aistgojp >

#declare VER=31;

#if (VER=35)
  #version 3.5;
  #include "functions.inc" 
#else          
  #version unofficial Megapov 0.7;
  #declare f_sphere=function{"sphere", <1>}    
  #declare f_r=function{"R"}    
  #declare f_th=function{"TH"}
#end

#declare Radiosity=off;    
#declare ISO= on;
#declare AREA_LIGHT= off;
#declare FOCAL_BLUR = off; 
#declare Blur_Smpl =8;

#declare F1=30;
#declare F2=30;
#declare F3=25;

global_settings {
  #if (Radiosity)
    radiosity {
      pretrace_start 0.08 pretrace_end   0.02    
      count 5  nearest_count 3 low_error_factor .5  minimum_reuse 0.05    
      adc_bailout 0.01/2  normal off
    }
  #end
}

camera {
  location  <0, 0, -6.5>  direction 0.9*z 
//  right x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
#if (FOCAL_BLUR)
  aperture 0.2  blur_samples Blur_Smpl        
  focal_point <0.,0,0.4>  confidence 0.95 variance 1/200            
#end
}

light_source { <-0,0,-40>  color rgb 1 
  #if (AREA_LIGHT)
    area_light <2.5, 0, 0>, <0, 2.5,0>, 2, 2  adaptive 1  jitter      
  #end
  fade_distance 30 fade_power 2}

light_source { <0,36,-40>  color rgb <1.0,0.9,0.8> 
  #if (AREA_LIGHT)
    area_light <2, 0, 0>, <0, 2,0>, 2, 2  adaptive 1  jitter      
  #end
  fade_distance 30 fade_power 2}

sky_sphere { pigment { gradient y 
 color_map{[.0 rgb<.35,.3,.2>] [.6 rgb<.40,.5,.65>][1. rgb<.35,.3,.2>]} }}



#macro SPHERE11(P1,P2)
#if (ISO & (P2>0.1))
  isosurface {
  #if (VER=35)
    function{f_sphere(x,y*0.7,z,1)
             +sin(f_th(x,0,z)*P1+f_r(x,0,z)*4)*0.15*f_r(x,0,z)+0.2}  
  #else
     function{f_sphere(x,y*0.7,z)
             +sin(f_th(x,0,z)*P1+f_r(x,0,z)*4)*0.15*f_r(x,0,z)+0.2}  
  #end
    contained_by{sphere{0,1}} 
    max_gradient 0.6+P1*0.1 accuracy 0.01               
//  evaluate off
#else
  sphere {0,1-P2*ISO  
#end
     texture{ pigment{ 
       function{(cos(f_th(x,0,z)*P1+f_r(x,0,z)*4)*f_r(x,0,z)+1.5)/2.5
                *f_r(x,0,z)}
       color_map{[0 rgb <0.5,0.25,0.1>] 
                 [.25 rgb <0.85,0.7,0.5>][.5 rgb 1][1 rgb 1]}}
  #if (Radiosity)
       finish{ambient 0.2}
  #else
       finish{ambient 0.35}
  #end
     }
     scale <1,0.12,1> 
  }
#end

#declare S1=0.6;               

#declare R1 = seed(1);
#declare N3=0;
#while (N3<F3)
  #declare N2=0;
  #while (N2<F2)
    #declare N1=0;
    #while (N1<F1) 
      #if (rand(R1)>0.6)
        object{
          SPHERE11(5+int(rand(R1)*10), rand(R1)) 
          rotate <rand(R1)*360,rand(R1)*360,rand(R1)*360> scale S1 
          translate <N1-F1/2+rand(R1)*0.4,N2-F2/2+rand(R1)*0.4,N3> }
      #end
      #declare N1=N1+1;
    #end
    #declare N2=N2+1;
  #end
  #debug  concat("N3:",str(N3,3,0),"\n")
  #declare N3=N3+1;
#end


Post a reply to this message

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