POV-Ray : Newsgroups : povray.general : Stupid SDL tricks: Self-replicating scene file : Re: Stupid SDL tricks: Self-replicating scene file Server Time
1 Aug 2024 16:30:22 EDT (-0400)
  Re: Stupid SDL tricks: Self-replicating scene file  
From: PM 2Ring
Date: 22 Jul 2005 03:50:01
Message: <web.42e0a2ee72a760c15464b3b50@news.povray.org>
"B. Gimeno" <NO_### [at] lycoses> wrote:
> uh?
>
> File Context (5 lines):
> "                                                               ",
> "#macro p(s)object{text{ttf "crystal
> Parse Error: Cannot assign uninitialized identifier.

The web interface is eating my backslashes! Backslashes have disappeared
from infront of the quote marks around the font name.  Very strange... Try
this version:

// SelfPrint.pov by PM 2Ring. 2005.5.16
// +A0.01 +AM2 +R4
camera{location -42*z}background{rgb .25}
#declare U=-26;#declare V=19;#declare Q=chr(34);

#macro p(s)object{text{ttf  "crystal.ttf ",s.1,0}pigment{rgb 1}
finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end

#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a))
#local c=substr(a,i,1);#if(!strcmp(c,Q))
#local b=concat(b,chr(92));#end#local b=concat(b,c);
#local i=i+1;#end concat(b,Q,chr(44))#end

#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end
#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end

#declare T=array[20]{
"// SelfPrint.pov by PM 2Ring. 2005.5.16                        ",
"// +A0.01 +AM2 +R4                                             ",
"camera{location -42*z}background{rgb .25}                      ",
"#declare U=-26;#declare V=19;#declare Q=chr(34);               ",
"                                                               ",
"#macro p(s)object{text{ttf \"crystal.ttf\",s.1,0}pigment{rgb 1}",
"finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end          ",
"                                                               ",
"#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a))          ",
"#local c=substr(a,i,1);#if(!strcmp(c,Q))                       ",
"#local b=concat(b,chr(92));#end#local b=concat(b,c);           ",
"#local i=i+1;#end concat(b,Q,chr(44))#end                      ",
"                                                               ",
"#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end           ",
"#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end        ",
"                                                               ",
"#declare T=array[20]{                                          ",
"};w(0,17)q(0,20)w(17,20)                                       ",
"                                                               ",
"//--------------------End of scene-------------------------    ",
};w(0,17)q(0,20)w(17,20)

//--------------------End of scene-------------------------


Post a reply to this message

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