POV-Ray : Newsgroups : povray.newusers : Calling a #macro gives error : Calling a #macro gives error Server Time
7 Jun 2024 21:20:10 EDT (-0400)
  Calling a #macro gives error  
From: gharryh
Date: 16 Jun 2013 07:30:01
Message: <web.51bda10dec77e24c520168c30@news.povray.org>
For a scene i would like to include a floor.
Therefore is modified the superellipsoid  example.
Running this whitout the #macro and #end the schene renders perfect

[code]
#macro Floor(MaxTile, MaxRow)
#declare Offset = 2.1;

  #declare Tile = superellipsoid { <0.5, 0.1>
    scale <1, .05, 1>
  }

#declare Row = union {
    object { Tile }

#declare index =-MaxTile;

#while(index <= MaxTile)
    object { Tile translate z*Offset*index }
#declare index = index + 1;
#end
  }

#declare index = -MaxRow;

  union{
    object { Row }

#while(index <= MaxRow)
    object { Row translate x*Offset*index }
#declare index = index + 1;
#end

    pigment { White_Marble }
    finish { phong 1 phong_size 50 reflection .35 }
  }

  plane {
    y, 0  //this is the grout
    pigment { color White }
    finish { ambient .4 diffuse .7 }
  }
#end
[/code]

But if i call it as a macro like object{Floor(10,10) } it produces a error at
the plane command. It puzzles me how this is possible. Anny help is welcome.


Post a reply to this message

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