POV-Ray : Newsgroups : povray.text.scene-files : beta 8 images bug Server Time
1 Jul 2024 03:09:45 EDT (-0400)
  beta 8 images bug (Message 1 to 3 of 3)  
From: PeterC
Subject: beta 8 images bug
Date: 6 Dec 2001 21:16:57
Message: <3c102654.10625072@localhost>
Source for the .pov script mentioned in the 3.5
beta test newsgroup.  Can you render this twice in a row
without a crash?  (first edit it to use an image that
you actually have in your pov path)

Pete

-- 
#version 3.5;

/* using newer 3.5 features to read in a color picture and render
   it in a scene as a w/w picture

   This version uses the grey level as an index into a color
   gradient.  Can use to this get sepia tones, blueiffied pics,
   or just get plain weird
*/


#macro lazy_map(lm_filename)
  #local lz_sl = strlen(lm_filename);
  #local lz_ext = strlwr(substr(lm_filename, lz_sl - 2, 3)) // get
file type
  #if (strcmp(lz_ext, "tga") = 0)
    tga lm_filename
  #else
    #if (strcmp(lz_ext, "png") = 0)
      png lm_filename
    #else
      #if (strcmp(lz_ext, "gif") = 0)
        gif lm_filename
      #else
        #if (strcmp(lz_ext, "iff") = 0)
          iff lm_filename
        #else
          sys lm_filename
        #end
      #end
    #end
  #end
#end


#macro rnd_rotate()
  rotate <360 * rand(rseed), 360 * rand(rseed), 360 * rand(rseed)>
#end


#macro rnd_translate()
  translate <4 - 8 * rand(rseed), 4 - 8 * rand(rseed), 4 - 8 *
rand(rseed)>
#end


#macro perturb()
  rnd_translate()
  rnd_rotate()
#end


#macro rrand(rlo, rhi)
  #local real_lo = min(rlo, rhi);
  #local real_hi = max(rlo, rhi);
  #local rr_result = real_lo + (rand(rseed) * (real_hi - real_lo));
  rr_result
#end


#macro rnd(nn)
  #local rnd_result = int(rand(rseed) * nn);
  rnd_result
#end


camera {
  location 0
  direction <0, 0, 3.8>
  right <(640 / 480), 0, 0>
  up <0, 1, 0>
  translate <0, 2, -13>  
}


#declare pic_pig = pigment {
  image_map {
//    lazy_map("test_gilles_pipes.tga")
    lazy_map("msqt.bmp")
    interpolate 2
  }
  scale 1.001
}


#declare pic_function = function {
  pigment { pic_pig }
}


box { // the piccy as is (color)
  <-0.5, -0.5, 0>, <0.5, 0.5, 0>
  pigment {
    pic_pig
    translate <-0.5, -0.5, 0>
  }
  finish { ambient 0.5 diffuse 0.5 }
  scale <640/480, 1, 1>
  scale 2.1
  translate <0.741, 1.45, 0>
}


box { // the piccy in greyscale
  <-0.5, -0.5, 0>, <0.5, 0.5, 0>
  pigment {
    function {
      pic_function(x, y, z).grey
    }
    color_map {
      [ 0.0 color rgb 0 ]
      [ 1.0 color rgb 1 ]
    }
    translate <-0.5, -0.5, 0>
  }
  finish { ambient 0.5 diffuse 0.5 }
  scale <640/480, 1, 1>
  translate <-1.48, 3.1, 0>
}


plane { // back wall
  <0, 0, -1>, -0.05
  pigment { color rgb 1 }
  finish { ambient 0.5 diffuse 0.5 }
}


light_source {
  <0, 0, -3000>
  color rgb 1
  area_light <800, 0, 0>, <0, 800, 0>, 5, 5 adaptive 1
  rotate x*8
  rotate x*30
  rotate y*45
}


/* actual end of this file */


Post a reply to this message

From: Mike Williams
Subject: Re: beta 8 images bug
Date: 7 Dec 2001 02:52:25
Message: <2MRacFAdLHE8Ew+u@econym.demon.co.uk>
Wasn't it  who wrote:
>
>       Source for the .pov script mentioned in the 3.5
>beta test newsgroup.  Can you render this twice in a row
>without a crash?  (first edit it to use an image that
>you actually have in your pov path)
>
>Pete
>

You seem to have failed to include the beta-8 workround line
                #declare foo=function{0}
which should be placed at the top of the scene file.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: PeterC
Subject: Re: beta 8 images bug
Date: 12 Dec 2001 21:36:01
Message: <3c180dae.9460593@localhost>
On Fri, 7 Dec 2001 07:42:21 +0000, Mike Williams <mik### [at] nospamplease>
wrote:


>You seem to have failed to include the beta-8 workround line
>                #declare foo=function{0}
>which should be placed at the top of the scene file.
>

	Yup.  A few days after I posted, I saw the
description of the workaround.  Sigh: latency as a result
of offline newsreading & posting.  :(

Pete


Post a reply to this message

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