POV-Ray : Newsgroups : povray.animations : HELP! problem with CSG syntax Server Time: 28 May 2020 22:17:18 GMT
  HELP! problem with CSG syntax (Message 1 to 3 of 3)  
From: Constantin
Subject: HELP! problem with CSG syntax
Date: 12 May 2020 02:15:00
Message: <web.5eba04fc45e5c9e8ecfb76150@news.povray.org>
I consider myself an advanced POV user but this one is mystifies me. I am trying
a simple model of a butterfly wing movement in a sort (12 frames, 3/4 sec)
animation. This is my code:

//rapid downstroke
#declare startclock=0;
#declare endclock =4;
#declare localclock=clock-startclock;
#if(clock>startclock & clock<=endclock) union { { Rightwing rotate
<0,0,60-14*localclock>} {Leftwing rotate<0,0,-(60-14*localclock)>}
rotate<-30,-30,0> translate <30,-(55-localclock), 50> }  #end

//slower return up
#declare startclock=endclock;
#declare endcolck=startclock+8;
#declare localclock=clock-startclock;
#if( clock>startclock & clock <=endclock) union { { Rightwing rotate<
0,0,7.5*localclock>} {Leftwing rotate<0,0,-7.5*localclock>}  rotate<-20,-35,0>
translate <10,-(54+0.5*localclock), 100>  }  #end

Povray refuses to accept the first #if statement: "No matching } in 'union', {
found instead" What is wrong with the union syntax?

More puzzling, if I comment out the first #if statement, it accepts the second
one and proceeds to rendering, even though the union syntax is EXACTLY the same.

What am I doing wrong?

Thanks for any help

Constantin


Post a reply to this message

From: Cousin Ricky
Subject: Re: HELP! problem with CSG syntax
Date: 12 May 2020 05:15:00
Message: <web.5eba309a515d007f60e0cc3d0@news.povray.org>
"Constantin" <con### [at] mcgillca> wrote:
> I consider myself an advanced POV user but this one is mystifies me. I am trying
> a simple model of a butterfly wing movement in a sort (12 frames, 3/4 sec)
> animation. This is my code:

You are missing the 'object' keyword:

> //rapid downstroke
> #declare startclock=0;
> #declare endclock =4;
> #declare localclock=clock-startclock;
> #if(clock>startclock & clock<=endclock) union { { Rightwing rotate
                                             here^
> <0,0,60-14*localclock>} {Leftwing rotate<0,0,-(60-14*localclock)>}
                 and here^
> rotate<-30,-30,0> translate <30,-(55-localclock), 50> }  #end
>
> //slower return up
> #declare startclock=endclock;
> #declare endcolck=startclock+8;
> #declare localclock=clock-startclock;
> #if( clock>startclock & clock <=endclock) union { { Rightwing rotate<
                                           and here^
> 0,0,7.5*localclock>} {Leftwing rotate<0,0,-7.5*localclock>}  rotate<-20,-35,0>
              and here^
> translate <10,-(54+0.5*localclock), 100>  }  #end
>
> Povray refuses to accept the first #if statement: "No matching } in 'union', {
> found instead" What is wrong with the union syntax?
>
> More puzzling, if I comment out the first #if statement, it accepts the second
> one and proceeds to rendering, even though the union syntax is EXACTLY the same.

The second #if is never satisfied, so POV-Ray never gets to flag it as a syntax
error.


Post a reply to this message

From: Constantin
Subject: Re: HELP! problem with CSG syntax
Date: 18 May 2020 00:50:01
Message: <web.5ec1dabe515d007fecfb76150@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> "Constantin" <con### [at] mcgillca> wrote:
> > I consider myself an advanced POV user but this one is mystifies me. I am trying
> > a simple model of a butterfly wing movement in a sort (12 frames, 3/4 sec)
> > animation. This is my code:
>
> You are missing the 'object' keyword:

You were absolutely right, that's all I needed to do. Rusty skills, I hadn't
used POV for years.

Many thanks!

Constantin


Post a reply to this message

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