POV-Ray : Newsgroups : povray.newusers : Re: Vibrate objects in animation Server Time
4 Nov 2024 19:14:42 EST (-0500)
  Re: Vibrate objects in animation (Message 1 to 8 of 8)  
From: Bathurstfreak
Subject: Re: Vibrate objects in animation
Date: 24 Nov 2004 17:30:01
Message: <web.41a509ecfa0d3b25fce34a90@news.povray.org>
The primary way to vibrate an object is to translate or rotate using sin and
cos. depending on your model you could even damp the function over time.

#include "transforms.inc"

#declare damping = 5;
// no.s greater than 0 damp the vibration
// no.s less than zero excite the vibration

#declare frequency = 5;
#declare framerate = 25;
#declare frames = 100

#declare xvibrate =
distance*cosd(clock*360*(frames/framerate)*frequency)*pow(2.817,-clock*(frames/framerate)*damping);


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Vibrate objects in animation
Date: 25 Nov 2004 13:12:13
Message: <41a6207d$1@news.povray.org>
Thanks for the answer.

Why I can not write this:
======================================
rotate <xvibrate, 0, 0>?
======================================
It gives me an error.

Thanks again,
Oleguer




news:web.41a509ecfa0d3b25fce34a90@news.povray.org...
> The primary way to vibrate an object is to translate or rotate using sin
and
> cos. depending on your model you could even damp the function over time.
>
> #include "transforms.inc"
>
> #declare damping = 5;
> // no.s greater than 0 damp the vibration
> // no.s less than zero excite the vibration
>
> #declare frequency = 5;
> #declare framerate = 25;
> #declare frames = 100
>
> #declare xvibrate =
>
distance*cosd(clock*360*(frames/framerate)*frequency)*pow(2.817,-clock*(fram
es/framerate)*damping);
>
>
>
>


Post a reply to this message

From: Bathurstfreak
Subject: Re: Vibrate objects in animation
Date: 25 Nov 2004 21:20:00
Message: <web.41a6923ffa0d3b25fce34a90@news.povray.org>
> Why I can not write this:
> ======================================
> rotate <xvibrate, 0, 0>?
> ======================================
> It gives me an error.

the cosd function requires that transforms.inc has been included into the
script
the other way is to use not worrying about transforms.inc
cos(clock*2*pi*[rest_of_function]) instead of
cosd(clock*360*[rest_of_function])

#include "transforms.inc"
> > #declare damping = 5;
> > #declare frequency = 5;
> > #declare framerate = 25;
> > #declare frames = 100
> >
#declare xvibrate = [distance or rotation
angle]*cosd(clock*360*(frames/framerate)*frequency)*pow(2.817,-clock*(frames/framerate)*damping);


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Vibrate objects in animation
Date: 26 Nov 2004 11:16:12
Message: <41a756cc@news.povray.org>
Yes, but your function is:
======================================
#include "transforms.inc"

#declare damping = 5;
#declare frequenci = 5;
#declare framerate = 25;
#declare frames = 100;

#declare xvibrate =
distance*cosd(clock*360*(frames/framerate)*frequenci*pow(2.817,-clock*(frame
s/framerate)*damping);
=======================================
xvibrate is  the name of the function, so, why I can not  write "object {
Prot translate <xvibrate, 0, 0> }"?

If I put this:
=======================================
object { Prot translate
<cos(clock*2*pi*(frames/framerate)*frequenci)*pow(2.817,-clock*(frames/frame
rate)*damping), 0, 0> }

#declare damping = 5;
#declare frequenci = 5;
#declare framerate = 25;
#declare frames = 100;
=======================================
The program gives me this error: " Expected numeric expression, undeclared
identifier frames found instead.
Why this error? I have declared it above.

All my objects are:
=======================================
 object { ROM2 translate <0, 0, 0> translate <0.5*pi*clock, 0.2*pi*clock,
0> }
object { RHO1 translate <0, -0.2, 0> translate <-0.3*pi*clock, 0.2*pi*clock,
0> }
object { PKC1 translate <0, 0, 0> translate <0.3*pi*clock, 0.2*pi*clock,
0> }
object { BCK1 translate <0, 0, 0> translate <-0.31*pi*clock, 0.18*pi*clock,
0> }
object { MKK1_MKK2 translate <0, 0, 0> translate <0.2*pi*clock,
0.18*pi*clock, 0>}
object { Slt2 translate <-0.3*pi*clock, 0.2*pi*clock, 0> translate <0, -0.5,
0> }

object { Prot }
=======================================

Thanks for the help,
Oleguer





news:web.41a6923ffa0d3b25fce34a90@news.povray.org...
> > Why I can not write this:
> > ======================================
> > rotate <xvibrate, 0, 0>?
> > ======================================
> > It gives me an error.
>
> the cosd function requires that transforms.inc has been included into the
> script
> the other way is to use not worrying about transforms.inc
> cos(clock*2*pi*[rest_of_function]) instead of
> cosd(clock*360*[rest_of_function])
>
> #include "transforms.inc"
> > > #declare damping = 5;
> > > #declare frequency = 5;
> > > #declare framerate = 25;
> > > #declare frames = 100
> > >
> #declare xvibrate = [distance or rotation
>
angle]*cosd(clock*360*(frames/framerate)*frequency)*pow(2.817,-clock*(frames
/framerate)*damping);
>
>
>


Post a reply to this message

From: Bathurstfreak
Subject: Re: Vibrate objects in animation
Date: 26 Nov 2004 21:45:00
Message: <web.41a7e9fefa0d3b25c958ff900@news.povray.org>
that really is bizarre, I'll have to look at the code. Post it in the code
postings forum page and I'll have a look at it.


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Vibrate objects in animation
Date: 27 Nov 2004 05:17:55
Message: <41a85453$1@news.povray.org>
Maybe I'm not doing it right. Test the things that I told, because maybe the
problem is mine.

Regards,
Oleguer




news:web.41a7e9fefa0d3b25c958ff900@news.povray.org...
> that really is bizarre, I'll have to look at the code. Post it in the code
> postings forum page and I'll have a look at it.
>
>
>


Post a reply to this message

From: Bob Hughes
Subject: Re: Vibrate objects in animation
Date: 4 Dec 2004 12:03:00
Message: <41b1edc4$1@news.povray.org>
Noticed you used a reserved keyword, 'distance', in the first xvibrate. To 
avoid conflict the usual practice is to use capital letters for your 
identifiers, so Distance would be okay. Oh, and there is also a missing ')' 
after frequenci.

Tried the second equation (one with cos instead of cosd) and it seems to do 
what it probably should be doing; although, at damping=5 it ends very 
quickly, only 1/4 of the way into animation. By using 1.5 it seemed to last 
3/4 through the animation of 100 frames.

Bob H.


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Vibrate objects in animation
Date: 8 Dec 2004 14:50:40
Message: <41b75b10$1@news.povray.org>
Thanks Bob.

Best regards,
Oleguer




news:41b1edc4$1@news.povray.org...
> Noticed you used a reserved keyword, 'distance', in the first xvibrate. To
> avoid conflict the usual practice is to use capital letters for your
> identifiers, so Distance would be okay. Oh, and there is also a missing
')'
> after frequenci.
>
> Tried the second equation (one with cos instead of cosd) and it seems to
do
> what it probably should be doing; although, at damping=5 it ends very
> quickly, only 1/4 of the way into animation. By using 1.5 it seemed to
last
> 3/4 through the animation of 100 frames.
>
> Bob H.
>
>


Post a reply to this message

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