POV-Ray : Newsgroups : povray.bugreports : pov 3.7 array and for strangeness : pov 3.7 array and for strangeness Server Time
30 May 2023 07:26:25 EDT (-0400)
  pov 3.7 array and for strangeness  
From: Leroy
Date: 14 May 2023 17:20:00
Message: <web.6461437cd2bf0d2217fae25f712fc00@news.povray.org>
A while ago I made some POV code to turn a 2meg color tga (made by POV) into a
256 color palette pcx. This was for the old Quake2 game.

I used this in a mac to save the file:

   #local Tc=Image_Width * Image_Height;
    #write (Mfile,uint8 Image[a])// The image array contain Integers<256
I had no problems, as the Image_Width & Image_Height where rather small 400*400.

Lately I tried to use the same code to save a much larger image array
The Image just didn't work. After going through the code a dozen times looking
for bugs. I decided to try and make the POV crash on purpose.
So I tried this.

   #local Tc=Image_Width * Image_Height;
   #for(a,0,Tc)//--- notice the change------
    #write (Mfile,uint8 Image[a])// The image array still contain Integers<256
POV didn't crash !?  And the image worked!!

To see what the output was I saved the Image array into POV file as an Named
array and ran that file to see if the array would work.
 neither of the codes above made a good array with out a lot of tweeking.

Not satisfied I tried this:

   #local Tc=Image_Width * Image_Height;
   #local a=0;
    #write (Mfile,uint8 Image[a])
    #local a=a+1;
Everything worked as expected!!

So what ya think?

I've got:: POV version 3.7.0.RC7.mevc10.sse.win32 running on an winXP.

Have fun!!

Post a reply to this message

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