POV-Ray : Newsgroups : povray.beta-test : Function image type mirrored vertically : Re: Function image type mirrored vertically Server Time
29 Jul 2024 22:21:56 EDT (-0400)
  Re: Function image type mirrored vertically  
From:
Date: 8 Apr 2002 11:40:53
Message: <abc3bugoeos5kvl7j8fb3t15t9ttjk4l4g@4ax.com>
On Mon, 8 Apr 2002 16:51:49 +0200, "Rune" <run### [at] mobilixnetdk> wrote:
> In POV-Ray x is defined as right and y is defined as up.

here is my imagination of internal behaviour :

// get dimensions from script
#declare GridX=100;
#declare GridY=100;

// get function from script
#declare Content = function (x,y,z) { ... };

// create internal image as grid of values like other images
#local Image=array[GridX][GridY];

// run loop over function - array coordinates are coordinates on xy plane

#local Z=0;
#local X=0;
#while ( X/(GridX-1) <= 1 )
  #local Y=0;
  #while ( Y/(GridY-1) <= 1 )
    #local Image[X][Y] = Content(X,Y,Z); // nothing is reversed in grid
    #local Y=Y+1;
  #end
  #local X=X+1;
#end

// now content is array with image/grid of values
// put it to general procedure for all image types
// this is unified procedure for all images
// no internal handling for function images

#macro CreateFunctionFromImage(x,y,z,Image)
  #local ImageX = X;
  #local ImageY = 1-Y // becouse first line of image is top line on screen
  function{ Image( ImageX , ImageY, 0 ) }
#end

ABX


Post a reply to this message

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