POV-Ray : Newsgroups : povray.advanced-users : Math help needed please. : Re: Math help needed please. Server Time
30 Jul 2024 14:16:32 EDT (-0400)
  Re: Math help needed please.  
From: Ken
Date: 18 Apr 1999 22:09:36
Message: <371A80F1.7AF191A8@pacbell.net>
Andrew Cocker wrote:
> 
> Ken <tyl### [at] pacbellnet> wrote in message news:371A602B.49520542@pacbell.net...
> >
> > Hi Andy,
> >
> >   While not a definitve answer to your question one of the first examples
> > given in the animation tutorial section of the Pov-Ray docs provides scripts
> > showing how to roll a sphere along a floor, have it turn and then come back
> > halfway. Scaling the object as it rolls would involve subtacting the
> > difference in size and using it as a function to specify the y translation
> > component of the objects translate action. While not a super easy thing to
> > figure out it should not take advanced math functions to get the job done.
> >
> 
> Thanks Ken,
> 
>     Yeah, I was aware of that example. I approach all problems like this absolutely
> befuddled. Sometimes, after some thought, the answer jumps out at me, but this time
it
> didn't/hasn't yet. Obviously it's easy to work out the vertical translation at clock
0.5,
> as it's the post-scaled radius of the sphere plus the plane's y translation ( in
this
> case -0.75 ). But I can't get my head round how to work out the amount for clock
0.24 etc.
> It's probably really simple.
>     I should point out that I haven't even started coding this one yet ( trying to
think
> it through first ), and doing so may prod my sleeping brain into ( slothfull )
action.
> 
> thanks again,
> 
> ----------------------
> Andy

 I would think you simply attach the scaled difference to the clock
function inside the translate statement. If you need this action to
only occur within a certain time frame as you indicate is the case
you can set up the movement of the object for that particular segment
of the clock using #if #else statements. This too is detailed in the
tutorials section of the docs althought the possible uses are not so
well defined for you.
  This is one case where you would benefit from breaking up the movement
into different segments instead of treating it as a function of the entire
clock cycle of 0 - 1.

It would be kind of like this:

 // do nothing between clock 0 - .25
#if MyClock = (clock < .25 )

object { stuff translate <0, 0, 0> }

#else

 //do something between clock .25 - .5
#if MyClock = (clock <= .5 )

object { stuff translate <0, -.25*MyClock, 0> } 

#else

 // do nothing between clock .5 - 1
#if MyClock = (clock > .5 )

object {stuff translate <0, 0, 0> }

#else

  This is the basic idea even if I screwed up the syntax of the example.
See the docs for the correct way to specify it.

 This also gives you the ability to have many different objects performing
differnt actions based on a clock cycle of 0 - 1 but each acting within
a predefined segement of that clock cycle.

 There are users out there that can give better examples than I can.
I have studied the animation process enough that I know it's possibilities
but do so little animation work that I have little practical experience
to provide you with working examples.



-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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