POV-Ray : Newsgroups : povray.programming : Programming Help Wanted : Re: Programming Help Wanted Server Time
28 Jul 2024 12:33:28 EDT (-0400)
  Re: Programming Help Wanted  
From: Warp
Date: 10 Sep 2001 19:36:13
Message: <3b9d4e6d@news.povray.org>
However, you can achieve this by using pigment functions.

  This is an example which supposes that "image.png" is 160x120:


#declare Image =
  function
  { pigment { image_map { png "image.png" } }
  }

#default { finish { ambient 1 } }

union
{ #declare IndY = 0;
  #while(IndY < 120)
    #declare IndX = 0;
    #while(IndX < 160)

      #declare Color = Image(IndX/160, IndY/120, 0); // The trick

      box { <IndX,IndY,0><IndX+1,IndY+1,1> pigment { color Color } }
      #declare IndX = IndX+1;
    #end
    #declare IndY = IndY+1;
  #end
  translate <-160/2, -120/2>
  scale 1/160
}

camera { location -z look_at 0 }


-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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