POV-Ray : Newsgroups : povray.newusers : need some help ! Server Time
1 Nov 2024 04:13:47 EDT (-0400)
  need some help ! (Message 1 to 5 of 5)  
From: kurtz le pirate
Subject: need some help !
Date: 14 Nov 2010 06:05:23
Message: <kurtzlepirate-2E05A9.12053314112010@news.povray.org>
hi,

i get this error but i am unable to understand why.
everything seems good...


File Context (5 lines):
  #local a = 1/sqrt(2.0);
  #local i = 0;
  #while(i<6)
    p[i].x =
Parse Error: All #declares of float, vector, and color require 
semi-colon ';' at end if the language version is set to
 3.5 or higher. Either add the semi-colon or set the language version to 
3.1 or lower.


source code :
#macro CreateNSphere (iterationNumber)

  #local p = array[6];
  #local p[0] = < 0, 0, 1>;
  #local p[1] = < 0, 0,-1>;
  #local p[2] = <-1,-1, 0>;
  #local p[3] = < 1,-1, 0>;
  #local p[4] = < 1, 1, 0>;
  #local p[5] = <-1, 1, 0>;

  // --- Create the level 0 object
  #local a = 1/sqrt(2.0);
  #local i = 0;
  #while(i<6)
    p[i].x = a*p[i].x;
    p[i].y = a*p[i].y;
    #local i=i+1;
  #end
  
  #declare facettes[0] = triangle { p[0], p[3], p[4] };
  ...
  ...

and this macro is called with this line :

  #declare fCreated = CreateNSphere(0);


nothing too complicated :(((

thanks
-- 
klp


Post a reply to this message

From: Jim Holsenback
Subject: Re: need some help !
Date: 14 Nov 2010 07:46:30
Message: <4cdfda26$1@news.povray.org>
On 11/14/2010 07:05 AM, kurtz le pirate wrote:
>     p[i].x = a*p[i].x;
>     p[i].y = a*p[i].y;

forgot something?


Post a reply to this message

From: StephenS
Subject: Re: need some help !
Date: 14 Nov 2010 08:15:00
Message: <web.4cdfe0bb48b0137b3cc273c80@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 11/14/2010 07:05 AM, kurtz le pirate wrote:
> >     p[i].x = a*p[i].x;
> >     p[i].y = a*p[i].y;
>
> forgot something?

#declare or #local I think...

Stephen S


Post a reply to this message

From: Alain
Subject: Re: need some help !
Date: 14 Nov 2010 15:00:58
Message: <4ce03ffa$1@news.povray.org>

> Jim Holsenback<jho### [at] povrayorg>  wrote:
>> On 11/14/2010 07:05 AM, kurtz le pirate wrote:
>>>      p[i].x = a*p[i].x;
>>>      p[i].y = a*p[i].y;
>>
>> forgot something?
>
> #declare or #local I think...
>
> Stephen S
>
>
#local if you only use the array inside that macro.
#declare if you need your array outside the macro, of the array is first 
declared outside the macro.



Alain


Post a reply to this message

From: kurtz le pirate
Subject: Re: need some help !
Date: 15 Nov 2010 05:02:31
Message: <kurtzlepirate-09F7E1.11022915112010@news.povray.org>
In article <web.4cdfe0bb48b0137b3cc273c80@news.povray.org>,
 "StephenS" <nomail@nomail> wrote:

> Jim Holsenback <jho### [at] povrayorg> wrote:
> > On 11/14/2010 07:05 AM, kurtz le pirate wrote:
> > >     p[i].x = a*p[i].x;
> > >     p[i].y = a*p[i].y;
> >
> > forgot something?
> 
> #declare or #local I think...


yes, you're right. it's too obvious :((
thanks

-- 
klp


Post a reply to this message

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