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