POV-Ray : Newsgroups : povray.binaries.scene-files : Why do I get only zeroes? Server Time
1 Sep 2024 16:19:29 EDT (-0400)
  Why do I get only zeroes? (Message 1 to 2 of 2)  
From: Yadgar
Subject: Why do I get only zeroes?
Date: 20 Aug 2004 18:56:56
Message: <412681b8$1@news.povray.org>
High!

I just started to program a skript which should generate color_maps from 
bitmap files... but eval_pigment doesn't seem to work as expected!

Whenever I run the skript, the generated satring.pov contains only 
zeroes instead of the real red values from the read-in bitmap!

Another strange thing is that, otherwise than in the PoV 3.5 manual 
stated, #write accepts only strings, not floats or vectors!

Here is the code:

#include "c:\Programme\POV-Ray for Windows v3.5/include/functions.inc"

#declare Sample=
pigment
{
   image_map
   {
     png "e:\povdaten\Sonnensystem\Saturn\ring_sample_color.png"
     once
   }
   scale <1, 380, 1>
}

plane
{
   -z, 0
   texture
   {
     pigment { Sample }
     finish { ambient 1 }
   }
}

camera
{
   location <0, 190, -380>
   look_at <0, 190, 0>
   angle 50
}


#fopen Sample_File "e:\povscn\satring.pov" write
#declare i=0;
#while(i<256)
   #declare col=eval_pigment(Sample, <0.5, 380-i, 0>);

   #write (Sample_File, str(col.red, 3, 0), "\n")
   #declare i=i+1;
#end
#fclose Sample_File


Post a reply to this message

From: regdo
Subject: Re: Why do I get only zeroes?
Date: 10 Oct 2004 03:15:00
Message: <web.4168e0ff86be9bc0a613238d0@news.povray.org>
Yadgar <yaz### [at] gmxde> wrote:
>    #write (Sample_File, str(col.red, 3, 0), "n")

Hi.
I think your problem is in that line : try -1 as 3rd parameter :
#write (Sample_File, str(col.red, 3, -1), "n")


Post a reply to this message

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