POV-Ray : Newsgroups : povray.text.scene-files : Help needed Server Time
29 Jul 2024 00:26:51 EDT (-0400)
  Help needed (Message 1 to 4 of 4)  
From: Ph Gibone
Subject: Help needed
Date: 1 May 1999 03:31:09
Message: <372a9fad.0@news.povray.org>
Could anybody (I don't mean *YOU* NdP (Not Dignified Pover)) tell me what's
wrong with this code :

All I get for yy is -nan (means "minus Not A Number(BTW I wonder what the
minus means if it is not a number ?))

If I take out the comment #debug str(tt,5,3), I get a GPF in PovEngine.exe
!!

HYCH (Hope you can Help) ;-}

Philippe

PS : Sorry Ken it's indented



#macro DrawJulia (cx, cy, MaxIter)

     #declare i = 0;
     #declare xx = -2;
     #declare tt = 0;
     #while (xx < 2)
          #declare yy = -2;
          #while (yy < 2)
               #while (i < MaxIter)
                    #declare tt = xx*xx - yy*yy + cx;
//                  #debug str(tt,5,3)
                    #declare yy = 2*xx*yy + cy;
                    #declare xx = tt;

                    #if (xx*xx + yy*yy > 4)
                         #break
                    #end
                    #declare i = i  + 1;
               #end
               #if (i = MaxIter)
                    sphere {<xx, yy, 0>, .1 pigment {color rgb <1,0,0,>}  }
               #end
               #declare yy = yy + 4/100;
               #warning "yy = "
               #warning str(yy,5, 3)
               #warning "\n"
          #end
          #declare xx = xx + 4/100;
          #warning "xx = "
          #warning str(xx,5, 3)
          #warning "\n"
     #end
#end

DrawJulia(-1.5, 0, 150)


Post a reply to this message

From: Jerome
Subject: Re: Help needed
Date: 4 May 1999 06:31:41
Message: <372EBE7D.D142477D@iname.com>
Anyway, it doesn't do what you wanted. You should use
diferrent variables than xx and yy in your external loops
(e.g. #while (sx < 2) and #while (sy < 2) and add #declare
xx = sx ; #declare yy = sy ; just before #while (i <
MaxIter))

	As for the error, do you get it immediately, or does it
loop some before crashing? (if the second, I'd be interested
in seeing the values of tt, xx, and yy just before the
crash...)

-- 
*******************************

* they'll tell you what can't * mailto:ber### [at] inamecom
* be done and why...          * http://www.enst.fr/~jberger
* Then do it.                 *
*******************************


Post a reply to this message

From: Ph Gibone
Subject: Re: Help needed
Date: 4 May 1999 08:21:20
Message: <372ed830.0@news.povray.org>
>Anyway, it doesn't do what you wanted. You should use
>diferrent variables than xx and yy in your external loops
>(e.g. #while (sx < 2) and #while (sy < 2) and add #declare
>xx = sx ; #declare yy = sy ; just before #while (i <
>MaxIter))

Right, and it has been fixed (and now it works) !, but it doesn't explain
the -nan !

> As for the error, do you get it immediately, or does it
>loop some before crashing? (if the second, I'd be interested
>in seeing the values of tt, xx, and yy just before the
>crash...)
No way : it crashes when I want to call #warning  str(tt, 5,0) (1st time)

Thanks for helping
Philippe


Post a reply to this message

From: Jerome
Subject: Re: Help needed
Date: 6 May 1999 07:51:05
Message: <37317418.5734F313@iname.com>
Ph Gibone wrote:
> 
> >Anyway, it doesn't do what you wanted. You should use
> >diferrent variables than xx and yy in your external loops
> >(e.g. #while (sx < 2) and #while (sy < 2) and add #declare
> >xx = sx ; #declare yy = sy ; just before #while (i <
> >MaxIter))
> 
> Right, and it has been fixed (and now it works) !, but it doesn't explain
> the -nan !
	Well, usually nan represents infinity (when you divide
something by 0 for example, it doesn't always cause an
error, but returns nan), depends on your system...
	But here, I didn't see what could cause it :-(

> 
> > As for the error, do you get it immediately, or does it
> >loop some before crashing? (if the second, I'd be interested
> >in seeing the values of tt, xx, and yy just before the
> >crash...)
> No way : it crashes when I want to call #warning  str(tt, 5,0) (1st time)
> 
> Thanks for helping
> Philippe
	You're welcome

		Jerome

-- 
*******************************

* they'll tell you what can't * mailto:ber### [at] inamecom
* be done and why...          * http://www.enst.fr/~jberger
* Then do it.                 *
*******************************


Post a reply to this message

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