|
![](/i/fill.gif) |
Katherina nous apporta ses lumieres en ce 2007/08/08 06:46:
> Now I changed my code and put 2 successive #while loops here is my new code,
> but still it gives same error message, I really do not understand why?
>
>
>
>
> #declare i=0;
> #declare j=0;
The declaretion of the indexing MUST ALWAYS immediately precede the coresponding
#while statement.
>
>
> #while (i<31)
>
>
> #while (j<20)
>
>
> intersection{
>
> plane
> {<p[i][0],p[i][1],p[i][2]>,p[i][0]*q[i][0]+p[i][1]*q[i][1]+p[i][2]*q[i][2]
> }
>
>
> quadric
> {
>
>
<qq[j][2],qq[j][4],qq[j][6]>,<qq[j][7],qq[j][8],qq[j][9]>,<qq[j][1],qq[j][3],qq[j][5]>,qq[j][0]
>
> }
>
> }
>
>
> #declare i=i+1;
You must NEVER alter any indexing variable inside any loop but it's own. Here,
you increase both in the inner loop.
> #declare j=j+1;
>
> #end
>
> #end
>
You need to start with the intersection and put the loops inside the
intersection. Secondly, put the 2 loops one after the other, not one inside the
other.
intersection{
#declare I = 0;
#while(I < 31)
Your_planes
#declare I = I + 1;
#end// terminate the intersection of planes
#declare I = 0;// you can reuse the same variable
#while(I < 20)
Your_quadrics
#declare I = I + 1;
#end// terminate the intersection of quartics
texture{Your_texture}// unless you need each part to provide it's own texture
}// End of the intersection
--
Alain
-------------------------------------------------
'hAS ANYONE SEEN MY cAPSLOCK KEY?'
Post a reply to this message
|
![](/i/fill.gif) |