POV-Ray : Newsgroups : povray.binaries.animations : Strange birds Server Time
29 Jun 2024 00:15:29 EDT (-0400)
  Strange birds (Message 1 to 10 of 10)  
From: RusHHouR
Subject: Strange birds
Date: 23 Sep 2006 05:25:00
Message: <web.4514fc46ae8a189547d3ae5e0@news.povray.org>
Well, I guess I shouldnt really blame the birds...

Im making an animation of one of my old stills.
One thing is to make the birds fly around this tower, as seen in the posted
animation.

I use a spline to make them fly around in a certain kind of circular
pattern.

But, they only fly one lap... Im missing something here, how can I make them
loop the spline again and again? Thankful for help!

Code:

#declare batpath1=
spline {natural_spline

0.000, <50, 170, 195>,
0.200, <70, 175, 197>,
0.350, <85, 173, 225>,
0.450, <80, 165, 270>,
0.600, <45, 155, 285>,
0.750, <10, 170, 260>,
0.850, <15, 180, 210>,
1.000, <50, 170, 195>}




object {prismbat scale 0.23 rotate <-90,-35,15> translate <0,10,1>
translate (batpath1(clock*12))}


Post a reply to this message


Attachments:
Download 'castlevania.mpg' (359 KB)

From: Tim Nikias
Subject: Re: Strange birds
Date: 23 Sep 2006 06:45:29
Message: <45151049$1@news.povray.org>
RusHHouR wrote:
> I use a spline to make them fly around in a certain kind of circular
> pattern.
> 
> But, they only fly one lap... Im missing something here, how can I make them
> loop the spline again and again? Thankful for help!
> 

> translate (batpath1(clock*12))}

A spline only accepts values between 0 (beginning of spline) and 1 (end 
of spline). If you want it to repeat the path, the value has to start at 
0 again. This could be done like this:

#declare BatMover = clock*12;
#while (BatMover >= 1) #declare BatMover = BatMover-1; #end

and later use
translate (batpath1(BatMover))

Regards,
Tim

-- 
aka "Tim Nikias"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: RusHHouR
Subject: Re: Strange birds
Date: 23 Sep 2006 06:55:01
Message: <web.451511d3d3ee376a47d3ae5e0@news.povray.org>
Tim Nikias <JUS### [at] gmxnetWARE> wrote:
>
> A spline only accepts values between 0 (beginning of spline) and 1 (end
> of spline). If you want it to repeat the path, the value has to start at
> 0 again. This could be done like this:
>
> #declare BatMover = clock*12;
> #while (BatMover >= 1) #declare BatMover = BatMover-1; #end
>
> and later use
> translate (batpath1(BatMover))
>
> Regards,
> Tim
>
> --
> aka "Tim Nikias"
> Homepage: <http://www.nolights.de>


Ah, gonna try it out! Thanks Tim!


Post a reply to this message

From: RusHHouR
Subject: Re: Strange birds
Date: 23 Sep 2006 07:05:00
Message: <web.45151428d3ee376a47d3ae5e0@news.povray.org>
Ok, so if I got this right.. i need a new row for every time the clock
increases with one? Like this?

#declare BatMover = clock*12;
#while (BatMover >= 1) #declare BatMover = BatMover-1; #end
#while (BatMover >= 2) #declare BatMover = BatMover-2; #end
#while (BatMover >= 3) #declare BatMover = BatMover-3; #end

etc?


Post a reply to this message

From: Tim Nikias
Subject: Re: Strange birds
Date: 23 Sep 2006 07:34:23
Message: <45151bbf$1@news.povray.org>
RusHHouR wrote:
> Ok, so if I got this right.. i need a new row for every time the clock
> increases with one? Like this?
> 
> #declare BatMover = clock*12;
> #while (BatMover >= 1) #declare BatMover = BatMover-1; #end
> #while (BatMover >= 2) #declare BatMover = BatMover-2; #end
> #while (BatMover >= 3) #declare BatMover = BatMover-3; #end
> 
> etc?

Nope, that's not needed. The while-loop will loop as long as BatMover is 
larger than 1, and if so, it will subtract 1. Once BatMover is smaller 
than 1, it stops. So it's just the first line that's needed.
So, while BatMover initially runs from 0 to 12, whenever it gets larger 
than 1, the while-loop will subtract one and thus BatMover runs from 0 
to 1 twelve times over.

Regards,
Tim

-- 
aka "Tim Nikias"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: RusHHouR
Subject: Re: Strange birds
Date: 23 Sep 2006 08:10:01
Message: <web.45151fdad3ee376a47d3ae5e0@news.povray.org>
Tim Nikias <JUS### [at] gmxnetWARE> wrote:
> RusHHouR wrote:
> > Ok, so if I got this right.. i need a new row for every time the clock
> > increases with one? Like this?
> >
> > #declare BatMover = clock*12;
> > #while (BatMover >= 1) #declare BatMover = BatMover-1; #end
> > #while (BatMover >= 2) #declare BatMover = BatMover-2; #end
> > #while (BatMover >= 3) #declare BatMover = BatMover-3; #end
> >
> > etc?
>
> Nope, that's not needed. The while-loop will loop as long as BatMover is
> larger than 1, and if so, it will subtract 1. Once BatMover is smaller
> than 1, it stops. So it's just the first line that's needed.
> So, while BatMover initially runs from 0 to 12, whenever it gets larger
> than 1, the while-loop will subtract one and thus BatMover runs from 0
> to 1 twelve times over.
>
> Regards,
> Tim
>
> --
> aka "Tim Nikias"
> Homepage: <http://www.nolights.de>


Oh my, I see it now.. it's being "re-declared" every time, right.
How clever! And useful! :D Thx again!


Post a reply to this message

From: Mike Williams
Subject: Re: Strange birds
Date: 23 Sep 2006 09:09:49
Message: <$lB8GFAv$SFFFwDw@econym.demon.co.uk>
Wasn't it Tim Nikias who wrote:
>RusHHouR wrote:
>> I use a spline to make them fly around in a certain kind of circular
>> pattern.
>> 
>> But, they only fly one lap... Im missing something here, how can I make them
>> loop the spline again and again? Thankful for help!
>> 
>
>> translate (batpath1(clock*12))}
>
>A spline only accepts values between 0 (beginning of spline) and 1 (end 
>of spline). If you want it to repeat the path, the value has to start at 
>0 again. This could be done like this:
>
>#declare BatMover = clock*12;
>#while (BatMover >= 1) #declare BatMover = BatMover-1; #end
>
>and later use
>translate (batpath1(BatMover))

perhaps more elegant to use mod()

translate (batpath1(mod(clock*12),1))

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: Strange birds
Date: 23 Sep 2006 10:52:27
Message: <45154a2b@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Nikias wrote:
> #declare BatMover = clock*12;
> #while (BatMover >= 1) #declare BatMover = BatMover-1; #end
> 
	I would use:
#declare BatMover = clock*12;
#declare BatMover = BatMover - floor (BatMover);

		Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
|    mailto:jeb### [at] freefr      | ICQ:    238062172            |
|    http://jeberger.free.fr/     | Jabber: jeb### [at] jabberfr   |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFFUoqd0kWM4JG3k8RAtpUAKC2nv8OteP87EQw9fKwdjupnkTYkQCdGsUa
7KDK/SVvZXTPouHSMOULLRw=
=8AaH
-----END PGP SIGNATURE-----


Post a reply to this message

From: RusHHouR
Subject: Re: Strange birds
Date: 23 Sep 2006 15:15:01
Message: <web.451586ded3ee376a47d3ae5e0@news.povray.org>
mod...
floor...?

Well, the Nikias version worked perfect. (But Im sure he already knew that.)
The bats fly around that tower like crazy! :D

Thanks for your suggestions and help!


Post a reply to this message

From: Tim Nikias
Subject: Re: Strange birds
Date: 23 Sep 2006 16:01:51
Message: <451592af@news.povray.org>
RusHHouR wrote:
> mod...
> floor...?
> 
> Well, the Nikias version worked perfect. (But Im sure he already knew that.)
> The bats fly around that tower like crazy! :D
> 
> Thanks for your suggestions and help!
> 
> 

Well, I guess the floor-version is probably the best, as it's simple 
subtraction. The while-version is a little clumsy in comparison. If you 
ever want to become a programmer, use mod or floor. ;-)

(I'm a programmer, sort of. I'm more into theory and designing programms 
than actually programming them, so that's why such clumsy solutions come 
into my head.)

Regards,
Tim

-- 
aka "Tim Nikias"
Homepage: <http://www.nolights.de>


Post a reply to this message

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