POV-Ray : Newsgroups : povray.advanced-users : math support Server Time
26 Nov 2024 19:30:15 EST (-0500)
  math support (Message 1 to 6 of 6)  
From: Noah A
Subject: math support
Date: 27 Aug 1999 23:41:22
Message: <37C75A75.9104ACCC@powersurfr.com>
we need a support group for ppl addicted to math images.
how can i make it so that in a while it will go for a certain number and
skip like
go while 0-15 then to  45-30


Post a reply to this message

From: Mark Wagner
Subject: Re: math support
Date: 28 Aug 1999 01:09:26
Message: <37c76f06@news.povray.org>
Noah A wrote in message <37C75A75.9104ACCC@powersurfr.com>...
>we need a support group for ppl addicted to math images.
>how can i make it so that in a while it will go for a certain number and
>skip like
>go while 0-15 then to  45-30
>

#declare counter = 0;
#while(counter != 29)
    /*Do something*/
    #if(counter < 16)
        #declare counter = counter + 1;
    #end
    #if(counter > 16)
        #declare counter = counter - 1;
    #end
    #if(counter = 16)
        #declare counter = 45;
    #end
#end

Mark


Post a reply to this message

From: Ken
Subject: Re: math support
Date: 28 Aug 1999 07:09:31
Message: <37C7C30F.E6A319F7@pacbell.net>
Noah A wrote:
> 
> we need a support group for ppl addicted to math images.
> how can i make it so that in a while it will go for a certain number and
> skip like
> go while 0-15 then to  45-30

This is not a math question as much as it is a proceedure question. Mark's
example looks good to me so I will defer to his narrative on the remainder
of you needs.

-- 
Ken Tyler

See my 850+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

From: Bob Hughes
Subject: Re: math support
Date: 28 Aug 1999 16:41:29
Message: <37c84979@news.povray.org>
Might also look into 'range' as well, used in the '#switch'
definition. Although the already said '#while' method seems perfectly
plausible for the problem. Except I would put the last '#if' in the
middle instead, and include a 30 check also. I might be in error so be
warned.

 #declare counter = 0;
 #while(counter != 29)
     /*Do something*/
     #if(counter < 16)
         #declare counter = counter + 1;
     #end
     #if(counter = 16)
         #declare counter = 45;
     #end
     #if(counter = 30)
         #declare counter = 29;
     #if(counter > 16)
         #declare counter = counter - 1;
     #end
 #end // 30 check
 #end

Bob

Mark Wagner <mar### [at] gtenet> wrote in message
news:37c76f06@news.povray.org...
>
> Noah A wrote in message <37C75A75.9104ACCC@powersurfr.com>...
> >we need a support group for ppl addicted to math images.
> >how can i make it so that in a while it will go for a certain
number and
> >skip like
> >go while 0-15 then to  45-30
> >
>
> #declare counter = 0;
> #while(counter != 29)
>     /*Do something*/
>     #if(counter < 16)
>         #declare counter = counter + 1;
>     #end
>     #if(counter > 16)
>         #declare counter = counter - 1;
>     #end
>     #if(counter = 16)
>         #declare counter = 45;
>     #end
> #end
>
> Mark
>
>
>


Post a reply to this message

From: Noah A
Subject: Re: math support
Date: 29 Aug 1999 02:50:01
Message: <37C8D82D.5C57E383@powersurfr.com>
i meant an easy way

Noah A wrote:

> we need a support group for ppl addicted to math images.
> how can i make it so that in a while it will go for a certain number and
> skip like
> go while 0-15 then to  45-30


Post a reply to this message

From: Remco de Korte
Subject: Re: math support
Date: 29 Aug 1999 04:51:32
Message: <37C8F008.7E3D963C@xs4all.nl>
Noah A wrote:
> 
> i meant an easy way
> 
> Noah A wrote:
> 
> > we need a support group for ppl addicted to math images.
> > how can i make it so that in a while it will go for a certain number and
> > skip like
> > go while 0-15 then to  45-30

#declare tt=0;  // counter
#declare dd=1;  // increment-step
#while (tt!=30)
  ---- do something! anything! ----
  #declare tt=tt+dd;
  #if (tt=15)
    #declare tt=45;
    #declare dd=-1;
  #end
#end

Remco


Post a reply to this message

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