|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-----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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|