POV-Ray : Newsgroups : povray.programming : sine/cosine and exponents with animations? Server Time
29 Jul 2024 00:34:53 EDT (-0400)
  sine/cosine and exponents with animations? (Message 1 to 8 of 8)  
From: Lounento
Subject: sine/cosine and exponents with animations?
Date: 30 Apr 1999 05:20:54
Message: <372967e6.0@news.povray.org>
Hi,
I've done some expirement animations with Povray, but have been missing a
couple of useful features. In order to make objects to move smoothly, the
object has to have a mathematical function that define the object's path.
Sine/cosine and exponent functions would be of great help there. Although
you can type "clock*clock" to make it a parabel, an exponent feature would
be much easier to use and it would also make possible to take the square
root (x^.5).
One other improvement would be an animation script through which you could
set individual enviroment for every frame of the animation.
For example: ball bouncing on th floor. The ball loses energy every time it
bounces from the floor (of course also in the air, but that's minimal) and
the maximal altitude lowers. A function which describes this is
y=<max.altitude>*sin x, where <max. altitude> is an individual value for
every bounce. It's value should be calculated for every bounce, not for
every frame.

This ball is one example, which would gain advantidge of all of those
features I'm missing:
1) sine function
2) ability to use exponent in scene language
3) a separate script file, which would control animation (for example:
calculate multipliers)

If someone has different solutions I'd gladly like to know about them.

Htl


Post a reply to this message

From: Juha Leppälä
Subject: Re: sine/cosine and exponents with animations?
Date: 30 Apr 1999 05:58:21
Message: <372970D4.6D3AE8FB@kolumbus.fi>
Lounento wrote:
> 
> Hi,
> I've done some expirement animations with Povray, but have been missing a
> couple of useful features. In order to make objects to move smoothly, the
> object has to have a mathematical function that define the object's path.
> Sine/cosine and exponent functions would be of great help there. Although
> you can type "clock*clock" to make it a parabel, an exponent feature would
> be much easier to use and it would also make possible to take the square
> root (x^.5).
> One other improvement would be an animation script through which you could
> set individual enviroment for every frame of the animation.
> For example: ball bouncing on th floor. The ball loses energy every time it
> bounces from the floor (of course also in the air, but that's minimal) and
> the maximal altitude lowers. A function which describes this is
> y=<max.altitude>*sin x, where <max. altitude> is an individual value for
> every bounce. It's value should be calculated for every bounce, not for
> every frame.
> 
> This ball is one example, which would gain advantidge of all of those
> features I'm missing:
> 1) sine function
POV has this, RTFM

> 2) ability to use exponent in scene language
POV has this, RTFM

> 3) a separate script file, which would control animation (for example:
> calculate multipliers)
POV has this as of 3.1, if you have it then RTFM. Otherwise go get it
 
> If someone has different solutions I'd gladly like to know about them.
> 
> Htl

I'm sorry but this is just a gross example of not reading the manual.
POV-Ray knows sin, cos and all that.

<Snippets from the manual>
cos(A) Cosine of A. Returns the cosine of the angle A, where A is
measured in radians.

sin(A) Sine of A. Returns the sine of the angle A, where A is measured
in radians. 

pow(A,B) Exponentiation. Returns the value of A raised to the power B.

sqrt(A) Square root of A. Returns the value whose square is A. 

<End snippet>

I didn't include the file handling routines, go read em yourself if you
need em. Please do read the whole manual :P



Post a reply to this message

From: Nieminen Mika
Subject: Re: sine/cosine and exponents with animations?
Date: 30 Apr 1999 09:09:31
Message: <37299d7b.0@news.povray.org>
Why don't you just read the manual?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Thomas Willhalm
Subject: Re: sine/cosine and exponents with animations?
Date: 30 Apr 1999 11:36:23
Message: <qqmpv4myy3d.fsf@goldach.fmi.uni-konstanz.de>
"Lounento" <som### [at] somewherecom> writes:

> I've done some expirement animations with Povray, but have been missing a
> couple of useful features. In order to make objects to move smoothly, the
> object has to have a mathematical function that define the object's path.
> Sine/cosine and exponent functions would be of great help there. Although
> you can type "clock*clock" to make it a parabel, an exponent feature would
> be much easier to use and it would also make possible to take the square
> root (x^.5).

Read the fine manual, in particular the section "Float Functions". Here's
an excerpt:

cos(A) Cosine of A. Returns the cosine of the angle A, where A is measured 
in radians.

exp(A) Exponential of A. Returns the value of e raised to the power A where e 
is the base of the natural logarithm, i.e. the
non-repeating value approximately equal to 2.71828182846.

sin(A) Sine of A. Returns the sine of the angle A, where A is measured in 
radians.

and many other useful functions.

Thomas

P.S.: I know that the Povray manual is huge and that one can easily overlook
a section.
P.P.S.: Please post your articles with real name.

-- 
http://www.fmi.uni-konstanz.de/~willhalm


Post a reply to this message

From: Ron Parker
Subject: Re: sine/cosine and exponents with animations?
Date: 30 Apr 1999 12:14:21
Message: <3729c8cd.0@news.povray.org>
>P.S.: I know that the Povray manual is huge and that one can easily overlook
>a section.
>P.P.S.: Please post your articles with real name.

P.P.P.S.: Please post your articles in a relevant newsgroup.  This question
belongs in povray.newusers or povray.general.  povray.programming is for the
discussion of the POV source code (C code, not POV-script) and programming
discussions related to the writing of other POV utilities.


Post a reply to this message

From: Simon de Vet
Subject: Re: sine/cosine and exponents with animations?
Date: 2 May 1999 10:07:17
Message: <372C4E17.DA9645A2@istar.ca>
Ron Parker wrote:

> >P.S.: I know that the Povray manual is huge and that one can easily overlook
> >a section.
> >P.P.S.: Please post your articles with real name.
>
> P.P.P.S.: Please post your articles in a relevant newsgroup.  This question
> belongs in povray.newusers or povray.general.  povray.programming is for the
> discussion of the POV source code (C code, not POV-script) and programming
> discussions related to the writing of other POV utilities.

This mistake is understandable, though... the description of this group on the
official POV site says: Programming with POV (incl. GUI Extensions)

Programming with POV can either mean programming FOR POV, as is interpreted by
the group, or programming IN POV, as was interpreted by the first poster.

It is something you cannot know a priori, only a posteriori.

I made this same mistake. As a matter of fact, I only realized specifically what
the group was for with this last post. I had also assumed it was both.

Ah well... maybe the description on the POV site whould be updated, save a little
confusion. :)

Simon
http://home.istar.ca/~sdevet


Post a reply to this message

From: Steve
Subject: Re: sine/cosine and exponents with animations?
Date: 3 May 1999 09:10:01
Message: <372D9317.340C4238@puzzlecraft.com>
Hi Lounento,

If you want to code this stuff directly, then you should study the manual.
However, Chris Colefax has already written a macro ( ClockMod ) that does all
of this for you and I have written a tutorial on using the macro.

If you want to discuss the ClockMod macro further, post a message in the
animation group and we'll get you going bouncing balls that lose energy,
accelerations, decellerations, cyclics, all of it.

steve


Lounento wrote:

> Hi,
> I've done some expirement animations with Povray, but have been missing a
> couple of useful features. In order to make objects to move smoothly, the
> object has to have a mathematical function that define the object's path.
> Sine/cosine and exponent functions would be of great help there. Although
> you can type "clock*clock" to make it a parabel, an exponent feature would
> be much easier to use and it would also make possible to take the square
> root (x^.5).
> One other improvement would be an animation script through which you could
> set individual enviroment for every frame of the animation.
> For example: ball bouncing on th floor. The ball loses energy every time it
> bounces from the floor (of course also in the air, but that's minimal) and
> the maximal altitude lowers. A function which describes this is
> y=<max.altitude>*sin x, where <max. altitude> is an individual value for
> every bounce. It's value should be calculated for every bounce, not for
> every frame.
>
> This ball is one example, which would gain advantidge of all of those
> features I'm missing:
> 1) sine function
> 2) ability to use exponent in scene language
> 3) a separate script file, which would control animation (for example:
> calculate multipliers)
>
> If someone has different solutions I'd gladly like to know about them.
>
> Htl


Post a reply to this message

From: Thomas Willhalm
Subject: Re: sine/cosine and exponents with animations?
Date: 3 May 1999 09:20:57
Message: <qqmiuaagx92.fsf@goldach.fmi.uni-konstanz.de>
par### [at] my-dejanewscom (Ron Parker) writes:

> >P.S.: I know that the Povray manual is huge and that one can easily overlook
> >a section.
> >P.P.S.: Please post your articles with real name.
> 
> P.P.P.S.: Please post your articles in a relevant newsgroup.  This question
> belongs in povray.newusers or povray.general.  povray.programming is for the
> discussion of the POV source code (C code, not POV-script) and programming
> discussions related to the writing of other POV utilities.

Yes and no. If POV-Ray had had to be patched for a sin function, this would
have been the correct group. (I decided to answer in this group, because I
expected the discussion to be short and therefore not worth to direct to 
another group.)

Thomas 

-- 
http://www.fmi.uni-konstanz.de/~willhalm


Post a reply to this message

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