 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi,
Starting with the following code:
sphere {
<0,0,0>,1
scale <0.25,1,0.25>
translate <-0.5,0,0>
texture { MyTexture }
}
plane
y, -1
texture { MyTexture }
}
I wish to rotate the sphere clockwise on the z axis by 180 degrees, at the same time
translating it along the x axis by 1 unit, so that it ends up at <0.5,0,0>.
The question is, how do I mathematically model the vertical motion so that the shape
appears to be rolling along the plane?NOTE: I may wish to alter the scale of the shape
*during* the anim, so this must be taken into account in the equation.
Any help appreciated.
--
----------------------
Andy
------------------------------------------------------------------------------------------
-
--The Home Of Lunaland--
--visit my POV-Ray gallery--
--listen to my music--
www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Cocker wrote:
>
> Hi,
>
> Starting with the following code:
>
> sphere {
> <0,0,0>,1
> scale <0.25,1,0.25>
> translate <-0.5,0,0>
> texture { MyTexture }
> }
>
> plane
>
> y, -1
> texture { MyTexture }
> }
>
> I wish to rotate the sphere clockwise on the z axis by 180 degrees, at the same time
> translating it along the x axis by 1 unit, so that it ends up at <0.5,0,0>.
> The question is, how do I mathematically model the vertical motion so that the shape
> appears to be rolling along the plane?NOTE: I may wish to alter the scale of the
shape
> *during* the anim, so this must be taken into account in the equation.
>
> Any help appreciated.
>
> --
> ----------------------
> Andy
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.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> 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
------------------------------------------------------------------------------------------
-
--The Home Of Lunaland--
--visit my POV-Ray gallery--
--listen to my music--
www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Cocker wrote:
>
> Ken <tyl### [at] pacbell net> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warning! I'm not a "Advanced User" I just play one on the home computer.
If I gather this right, sounds like you need a sin cos type thing for
the translation (one for x and one for y). However, why not just rotate
-clock*180*z while moving 1*x and use a math function on the scale y.
Without trying it out I don't know exactly what this would be.
sphere {
<0,0,0>,1
scale <0.25,H,0.25> //H increases/decreases to keep touch with floor
translate <-0.5,0,0>
rotate -clock*180*z translate clock*x
texture { MyTexture }
}
plane
y, -1
texture { MyTexture }
}
Sound about right anyone? Well, even close then?
--
omniVERSE: beyond the universe
http://members.aol.com/inversez/homepage.htm
mailto:inv### [at] aol com?Subject=PoV-News
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Well, I haven't done animations in POV yet. (I don't need a 4th dimension, I
have my head full with 3.)
>>>>>>>>>>>>Bob Hughes wrote:
<snip>
<remaking>
sphere {
<0,0,0>,1
scale <0.25,H,0.25> //H increases/decreases to keep touch with floor
translate <-0.5,0,0>
translate <0,-H/2,0> /* I think this must be added,
so it will keep in touch with the plane */
rotate -clock*180*z
translate clock*x
texture { MyTexture }
}
> plane {
>
> y, -1
> texture { MyTexture }
> }
>
> Sound about right anyone? Well, even close then?
>
> --
> omniVERSE: beyond the universe
> http://members.aol.com/inversez/homepage.htm
> mailto:inv### [at] aol com?Subject=PoV-News
--
//Spider
[ spi### [at] bahnhof se ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
"Marian"
By: "Sisters Of Mercy"
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Spider wrote:
>
> Well, I haven't done animations in POV yet. (I don't need a 4th dimension, I
> have my head full with 3.)
>
> >>>>>>>>>>>>Bob Hughes wrote:
> <snip>
> <remaking>
>
>
> sphere {
> <0,0,0>,1
> scale <0.25,H,0.25> //H increases/decreases to keep touch with floor
> translate <-0.5,0,0>
> translate <0,-H/2,0> /* I think this must be added,
> so it will keep in touch with the plane */
> rotate -clock*180*z
> translate clock*x
> texture { MyTexture }
> }
>
That was a good catch with the translate being one half of the spheres
scaled difference. If you used the total scale amount you would be
translating for the difference in size of both halfs of the radius.
and end up to 2 times farther that you need to be to stay in contact
with the surface of the plane.
To complete the above example and tie it to the clock try this:
// Assume the shere is 1 and you wand to have finish size of 0.5
#declare Diam = 1;
sphere {0, Diam
scale clock*0.5
rotate clock*180*z
translate < -0.5*clock, -Diam*0.5/2*clock, 0 >
texture { MyTexture }
}
I think !
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Spider wrote:
> scale <0.25,H,0.25> //H increases/decreases to keep touch with floor
> translate <-0.5,0,0>
> translate <0,-H/2,0> /* I think this must be added,
> so it will keep in touch with the plane */
> rotate -clock*180*z
Remember especialy with animations to rotate then translate or your object
will orbit instead of rotate.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Another good point, but wouldn't it be better to calculate the diameter formula
outside the sphere?
That way, you only need to do one change instead of two(I'm talking about the
Diam*0.5 .... lines..)
--
//Spider
[ spi### [at] bahnhof se ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
"Marian"
By: "Sisters Of Mercy"
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Spider wrote:
>
> Another good point, but wouldn't it be better to calculate the diameter formula
> outside the sphere?
>
> That way, you only need to do one change instead of two(I'm talking about the
> Diam*0.5 .... lines..)
>
> --
> //Spider
You need to remember that scaling in an animation is time dependant and by
using the clock the object will appear to gradualy deminish in size instead
of being seen as an instant change. The translate and the rotate need to be
tied together with a circumference operation to account for the fact
it is rolling as opposed to sitting and spinning but moving too. It's covered
in the docs like I said before. Good example that one.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sun, 18 Apr 1999 20:32:57 -0500, Bob Hughes <inv### [at] aol com>
wrote:
>Warning! I'm not a "Advanced User" I just play one on the home computer.
>
>If I gather this right, sounds like you need a sin cos type thing for
>the translation (one for x and one for y).
Consider this a step toward "Advanced Userhood", then: vrotate will
almost always do what you think you need sin and cos for, and will
usually be easier to read as well when you need to come back to it in
a month or two.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I can dream, yes :)
About the question at hand, I tried several potential ways via the sin
and pi and exp, etc. and failed to get the right answer. Math is not my
major good point, if I even have one at all.
Thing is this sounded simple enough. Scaling to meet the floor plane is
all while moving in a semi-circle, should just be a half sinusoidal
scale in the y.
I noticed Ken said:
----snipsity----
#declare Diam = 1;
sphere {0, Diam
scale clock*0.5
rotate clock*180*z
translate < -0.5*clock, -Diam*0.5/2*clock, 0 >
texture { MyTexture }
}
I think !
----snipperoonie---
'scale clock*0.5' is a wrong move. That will start as scale 1 then jump
back down to near nothing as it then climbs back up again. You'll
realize soon enough I'm sure.
And I realize I will always have something to learn. Thanks for the
little push Ron, I need that every so often.
"Ronald L. Parker" wrote:
>
> Consider this a step toward "Advanced Userhood", then: vrotate will
> almost always do what you think you need sin and cos for, and will
> usually be easier to read as well when you need to come back to it in
> a month or two.
--
omniVERSE: beyond the universe
http://members.aol.com/inversez/homepage.htm
mailto:inv### [at] aol com?Subject=PoV-News
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
errrmmmmmm...... It won't work. let me explain. Asphere with a radius of 1 has a
circumference of 2pi (roughly 6.2831 something something something). To model this
realistically, if the sphere were to rotate clockwise around the z axis one whole
revolution
then the appropriate movement along the x axis would be 2pi units long. Half the
rotation of
the ball is pi across the x axis (3.14159 and change). Moving only 1 unit would result
in the
ball spinning faster than it was moving. Fine for cue balls and Fred Flintstone (ever
notice
how his feet slide across the ground when he's walking?)
It sounds like the placement of the sphere is more important than how much it rotates,
so we
need to alter the amount of rotation. Keeping a ratio of 180/pi, where pi is the
distance
traveled and 180 is the rotation, we can create a formula or x/1 = 180/pi. x is the
rotation
needed to move 1 unit, and it is baiscally 57.295 plus a little extra. (At this point
I am
very grateuful that POV-Ray has pi as a built in value, thus saving lots of
calculations.)
Here is some code to generalize the movement:
#declare start_point = -0.5;
#declare end_point = 0.5;
#declare distance = end_point - start_point; // should be 1 in this example
#declare start_rotation = 0;
#declare end_rotation = distance*(180/pi);
#declare range = end_rotation - start_rotation;
// Now assume that the clock is going from 0 to 1, if it isn't the appropriate
formulas are at
// http://www.spiritone.com/~english/animaker/animaker.html
#declare current_rotation = start_rotation + (range * clock);
#declare current_translation = start_point + (distance * clock);
sphere { <0,0,0> 1
texture { MyTexture }
rotate current_rotation*z
translate current_translation * x
}
plane { y, -1
texture { MyOtherTexture } }
This covers the basics... altering the shape of the thing is slightly more complicated
to
calculate... but I'll look into it.
Josh English
eng### [at] spiritone com
Andrew Cocker wrote:
> Hi,
>
> Starting with the following code:
>
> sphere {
> <0,0,0>,1
> scale <0.25,1,0.25>
> translate <-0.5,0,0>
> texture { MyTexture }
> }
>
> plane
>
> y, -1
> texture { MyTexture }
> }
>
> I wish to rotate the sphere clockwise on the z axis by 180 degrees, at the same time
> translating it along the x axis by 1 unit, so that it ends up at <0.5,0,0>.
> The question is, how do I mathematically model the vertical motion so that the shape
> appears to be rolling along the plane?NOTE: I may wish to alter the scale of the
shape
> *during* the anim, so this must be taken into account in the equation.
>
> Any help appreciated.
>
> --
> ----------------------
> Andy
>
------------------------------------------------------------------------------------------
> -
> --The Home Of Lunaland--
> --visit my POV-Ray gallery--
> --listen to my music--
> www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sun, 18 Apr 1999 22:39:41 +0100, "Andrew Cocker"
<and### [at] acocker freeserve co uk> wrote:
>Hi,
>
>Starting with the following code:
>
>sphere {
> <0,0,0>,1
> scale <0.25,1,0.25>
> translate <-0.5,0,0>
> texture { MyTexture }
>}
>
>plane
>
> y, -1
> texture { MyTexture }
>}
>
>I wish to rotate the sphere clockwise on the z axis by 180 degrees, at the same time
>translating it along the x axis by 1 unit, so that it ends up at <0.5,0,0>.
>The question is, how do I mathematically model the vertical motion so that the shape
>appears to be rolling along the plane?NOTE: I may wish to alter the scale of the
shape
>*during* the anim, so this must be taken into account in the equation.
>
>Any help appreciated.
Now, a 180 degrees' roll of this objects makes for a x translation of
3.14159265, if you want it to roll correctly. If I understand your
question correctly, you are trying to model the behaviour of, say, an
unrolling rug, right? I mean, it moves, rolls, gets smaller, and stays
on the ground all at the same time.
The radius is a simple linear function:
r(clock) = startRad - clock*(startRad - endRad).
The y coordinate of the center is -1 + radius.
The x coordinate is found by integrating 2*pi*r(clock)*dclock in the
range from 0 to clock.
Am I getting the problem right? Is this of any help?
---------
Peter Popov
ICQ: 15002700
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Peter Popov <pet### [at] usa net> wrote in message
news:371b5d6a.3508620@news.povray.org...
> Now, a 180 degrees' roll of this objects makes for a x translation of
> 3.14159265, if you want it to roll correctly. If I understand your
> question correctly, you are trying to model the behaviour of, say, an
> unrolling rug, right? I mean, it moves, rolls, gets smaller, and stays
> on the ground all at the same time.
Err, no, just a sphere scaled into an ellipse rolling along. I realise I was wrong
expecting to be able to rotate 180 degrees in 1 unit, and I should now use 3.141...,
it's
the vertical position of the centre of the ellipse that I am still unclear about..how
it
moves down and then back up whilst keeping in contact with the floor. Surely this
value
will vary depending on the rotation, not the scale of the sphere. Forget that I
mentioned
changing the scale mid-anim..if I can get this to work as is, then I'll be happy.
> The y coordinate of the center is -1 + radius.
>
> The x coordinate is found by integrating 2*pi*r(clock)*dclock in the
> range from 0 to clock.
>
I'm fairly clear on this
> Am I getting the problem right? Is this of any help?
I'm slightly less in the dark, but no-one's switched the floodlights on yet ;-)
Andy
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Cocker wrote in message <371b934a.0@news.povray.org>...
>
>Err, no, just a sphere scaled into an ellipse rolling along. I realise I
was wrong
>expecting to be able to rotate 180 degrees in 1 unit, and I should now use
3.141..., it's
>the vertical position of the centre of the ellipse that I am still unclear
about..how it
>moves down and then back up whilst keeping in contact with the floor.
Surely this value
>will vary depending on the rotation, not the scale of the sphere. Forget
that I mentioned
>changing the scale mid-anim..if I can get this to work as is, then I'll be
happy.
>
First, remember that the cirumference of an ellipse is not 2*pi*r. An
approximation is 2*pi*sqrt[(a^2+b^2)/2] where a and b are lengths of major
and minor axes.
The other value you want - I haven't got right now. But why not just do
this: use the Superpatch's trace() function; trace a line from the centre
straight down. You can now get the radius for the current angle.
Basically like this:
#declare Ellipse=sphere{0,1 scale <.25,1,.25> rotate z*clock*360}
#declare Rad=trace(Ellipse,0,-y).y;
At least I think this should work.
Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ah ha. I was trying to rescale the sphere vertically while rotating and
keeping it lengthwise in the vertical. Then as it moved across the floor
it would grow and shrink back again as it moved upward and back down.
All wrong.
You needed an ellipse "rolling" along shorter diameter going closer then
back to starting orientation with the floor. I see now. Maybe.
Andrew Cocker wrote:
>
> Peter Popov <pet### [at] usa net> wrote in message
> news:371b5d6a.3508620@news.povray.org...
>
> > Now, a 180 degrees' roll of this objects makes for a x translation of
> > 3.14159265, if you want it to roll correctly. If I understand your
> > question correctly, you are trying to model the behaviour of, say, an
> > unrolling rug, right? I mean, it moves, rolls, gets smaller, and stays
> > on the ground all at the same time.
>
> Err, no, just a sphere scaled into an ellipse rolling along. I realise I was wrong
> expecting to be able to rotate 180 degrees in 1 unit, and I should now use 3.141...,
it's
> the vertical position of the centre of the ellipse that I am still unclear
about..how it
> moves down and then back up whilst keeping in contact with the floor. Surely this
value
> will vary depending on the rotation, not the scale of the sphere. Forget that I
mentioned
> changing the scale mid-anim..if I can get this to work as is, then I'll be happy.
>
> > The y coordinate of the center is -1 + radius.
> >
> > The x coordinate is found by integrating 2*pi*r(clock)*dclock in the
> > range from 0 to clock.
> >
>
> I'm fairly clear on this
>
> > Am I getting the problem right? Is this of any help?
>
> I'm slightly less in the dark, but no-one's switched the floodlights on yet ;-)
>
> Andy
--
omniVERSE: beyond the universe
http://members.aol.com/inversez/homepage.htm
mailto:inv### [at] aol com?Subject=PoV-News
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bob Hughes <inv### [at] aol com> wrote in message news:371BB225.808E7997@aol.com...
> Ah ha. I was trying to rescale the sphere vertically while rotating and
> keeping it lengthwise in the vertical. Then as it moved across the floor
> it would grow and shrink back again as it moved upward and back down.
> All wrong.
> You needed an ellipse "rolling" along shorter diameter going closer then
> back to starting orientation with the floor. I see now. Maybe.
Yes..you have it ;-)
Here we see the difficulty in solving a problem when it takes this many posts in a
thread
to even ascertain the nature of the problem ;-)
Maybe the fault lies with my explanation. Ah well......
all the best,
Andy
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Margus Ramst <mar### [at] peak edu ee> wrote in message news:371bb1cb.0@news.povray.org...
>
> First, remember that the cirumference of an ellipse is not 2*pi*r. An
> approximation is 2*pi*sqrt[(a^2+b^2)/2] where a and b are lengths of major
> and minor axes.
>
> The other value you want - I haven't got right now. But why not just do
> this: use the Superpatch's trace() function; trace a line from the centre
> straight down. You can now get the radius for the current angle.
>
> Basically like this:
>
> #declare Ellipse=sphere{0,1 scale <.25,1,.25> rotate z*clock*360}
> #declare Rad=trace(Ellipse,0,-y).y;
>
> At least I think this should work.
Thanks Margus,
I was hoping to avoid using the superpatch....I'm not at all familiar with the trace
function. But I will give it a go and see how I get on.
Andy
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Cocker wrote in message <371bbb59.0@news.povray.org>...
>
>I was hoping to avoid using the superpatch....I'm not at all familiar with
the trace
>function. But I will give it a go and see how I get on.
>
trace() is really quite simple yet very powerful. I think you will grow to
love it.
Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thank you for the circumference formula... I've been looking for it.
Here's the logic I've been applying:
1: create the unit sphere at the origin,
2: scale
3: rotate around z axis
4: translate against the y axis
5: translate against the x axis
steps 1,2, and 3 are easy. Step 4 is giving me headaches.
I've been playing with this code:
#declare x_scale = 0.25;
#declare y_scale = 1;
#declare rotation=60; // this can be anything, it's the control variable
#declare roff = 0 // or 90 or radians(90)
#declare centerX = cos(rotation-roff)*x_scale; // these should give us the x/y
values
#declare centerY = sin(rotation-roff)*y_scale; // of the edge of the sphere (z
axis)
#declare height=vlength(<centerX,centerY,0>);
This should give us the length from the edge of the sphere to the center (again
on the z axis, where the sphere
is biggest) and since the sphere is centered around the origin, simply
translate*height*y.
Of course, there is a basic flaw in this logic... The point that I'm measuring
to on the edge of the sphere is being rotated around the z axis. I haven't
found a way out of this trap yet. It looks like it should work... so what am I
missing? Is my process making any sense to anyone but me?
Josh English
eng### [at] spiritone com
Margus Ramst wrote:
> Andrew Cocker wrote in message <371b934a.0@news.povray.org>...
> >
> >Err, no, just a sphere scaled into an ellipse rolling along. I realise I
> was wrong
> >expecting to be able to rotate 180 degrees in 1 unit, and I should now use
> 3.141..., it's
> >the vertical position of the centre of the ellipse that I am still unclear
> about..how it
> >moves down and then back up whilst keeping in contact with the floor.
> Surely this value
> >will vary depending on the rotation, not the scale of the sphere. Forget
> that I mentioned
> >changing the scale mid-anim..if I can get this to work as is, then I'll be
> happy.
> >
>
> First, remember that the cirumference of an ellipse is not 2*pi*r. An
> approximation is 2*pi*sqrt[(a^2+b^2)/2] where a and b are lengths of major
> and minor axes.
>
> The other value you want - I haven't got right now. But why not just do
> this: use the Superpatch's trace() function; trace a line from the centre
> straight down. You can now get the radius for the current angle.
>
> Basically like this:
>
> #declare Ellipse=sphere{0,1 scale <.25,1,.25> rotate z*clock*360}
> #declare Rad=trace(Ellipse,0,-y).y;
>
> At least I think this should work.
>
> Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh English wrote in message <371BC172.F6F8B0AC@spiritone.com>...
>Thank you for the circumference formula... I've been looking for it.
>
It's an approximation, of course. The exact circumference is caclulated with
integrals.
As for your other method, I don't know... I think you'd need the foci of the
ellipse to calculate the radius. The sum of the distances from a point on
the ellipse to the foci is constant:
X - an arbitrary point on the ellipse
F1 and F2 - foci
XF1 + XF2 = 2 * major radius
You can also deduct that the distance from a focal point to the point where
the ellipse's radius is smallest (minor radius) = the major radius
It should now be quite easy to find the foci, given the major and minor
axes. From there, a bit of trig should give you the radius for any angle.
I'm thinking this up as I go, so I might be quite wrong. But if you feel
like it, give it a try (I don't feel like it, sorry :)
Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
eureka! (and I don't mean you need a bath) alter the code as follows:
#declare roff = 90;
#declare centerX = cos(radians(rotation-roff))*x_scale;
#declare centerY = sin(radians(rotation-roff))*y_scale;
This keeps the sphere on the ground. The next trick is to translate it accordingly.
I'll work on that.
Josh
Josh English wrote:
> Thank you for the circumference formula... I've been looking for it.
>
> Here's the logic I've been applying:
> 1: create the unit sphere at the origin,
> 2: scale
> 3: rotate around z axis
> 4: translate against the y axis
> 5: translate against the x axis
>
> steps 1,2, and 3 are easy. Step 4 is giving me headaches.
>
> I've been playing with this code:
>
> #declare x_scale = 0.25;
> #declare y_scale = 1;
>
> #declare rotation=60; // this can be anything, it's the control variable
> #declare roff = 0 // or 90 or radians(90)
>
> #declare centerX = cos(rotation-roff)*x_scale; // these should give us the x/y
> values
> #declare centerY = sin(rotation-roff)*y_scale; // of the edge of the sphere (z
> axis)
>
> #declare height=vlength(<centerX,centerY,0>);
>
> This should give us the length from the edge of the sphere to the center (again
> on the z axis, where the sphere
> is biggest) and since the sphere is centered around the origin, simply
> translate*height*y.
>
> Of course, there is a basic flaw in this logic... The point that I'm measuring
> to on the edge of the sphere is being rotated around the z axis. I haven't
> found a way out of this trap yet. It looks like it should work... so what am I
> missing? Is my process making any sense to anyone but me?
>
> Josh English
> eng### [at] spiritone com
>
> Margus Ramst wrote:
>
> > Andrew Cocker wrote in message <371b934a.0@news.povray.org>...
> > >
> > >Err, no, just a sphere scaled into an ellipse rolling along. I realise I
> > was wrong
> > >expecting to be able to rotate 180 degrees in 1 unit, and I should now use
> > 3.141..., it's
> > >the vertical position of the centre of the ellipse that I am still unclear
> > about..how it
> > >moves down and then back up whilst keeping in contact with the floor.
> > Surely this value
> > >will vary depending on the rotation, not the scale of the sphere. Forget
> > that I mentioned
> > >changing the scale mid-anim..if I can get this to work as is, then I'll be
> > happy.
> > >
> >
> > First, remember that the cirumference of an ellipse is not 2*pi*r. An
> > approximation is 2*pi*sqrt[(a^2+b^2)/2] where a and b are lengths of major
> > and minor axes.
> >
> > The other value you want - I haven't got right now. But why not just do
> > this: use the Superpatch's trace() function; trace a line from the centre
> > straight down. You can now get the radius for the current angle.
> >
> > Basically like this:
> >
> > #declare Ellipse=sphere{0,1 scale <.25,1,.25> rotate z*clock*360}
> > #declare Rad=trace(Ellipse,0,-y).y;
> >
> > At least I think this should work.
> >
> > Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thank you for such and intersesting challenge... I havne't found a solution but I'm
having fun
trying. I'm closer than I was this morning, tho.
Code:
#declare x_scale = 0.25;
#declare y_scale = 1;
#declare rotation = 45;
#declare roff = 90;
#declare centerX = cos(radians(rotation-roff))*x_scale;
#declare centerY = sin(radians(rotation-roff))*y_scale;
#declare correction = 180+degrees(atan2(centerX,centerY));
plane { y, 0 pigment { checker } }
sphere { <0,0,05> 1
pigment { radial frequency 8 rotate 90*x}
scale <x_scale,y_scale,1>
translate <-centerX,-centerY,0>
rotate correction*z
}
The advantage that this code has is that it keeps a point on the origin at all times.
If you
render a movie animating the rotation value from 0 to 180, making it a looping
animation, you
get a good walking motion. I'll post it to .animations (but it's a quicktime movie, I
don't
have mpeg conversion that I trust)
The advantage is that all we need to do next is translate the sphere appropriately
along the x
axis, but it wont be a continual movement. The animation will show this better than I
can
describe, but the horizontal movement is slower when the "top" and "bottom" of the
sphere are
touching, but faster when it rotates near 90 degrees. I did find a page that will
help:
http://www.geom.umn.edu/docs/reference/CRC-formulas/node29.html. As soon as we find a
solid
way to calculate the length of an arc on the sphere. There is a formula for this on
the page,
and I'll have to experiment with it. Once we have this our horizontal movement is
solved.
The disadvantage to this method, as the animation shows, is that part of sphere dips
under the
plane. This is the fault of the correction angle I'm using. It keeps the center of the
sphere
aligned with the y axis, but this doesn't give us the tangent which is what we need.
This
would work for a perfect sphere, but the scaled version requires a different method of
finding
thetangent and the perpidicular to the tangent.
In other words, you have opened up a huge can of worms and I'm looking for another
can. If
somebody else has solved the problem and has done this in an easier way, please post
it!
Josh English
eng### [at] spiritone com
Andrew Cocker wrote:
> Hi,
>
> Starting with the following code:
>
> sphere {
> <0,0,0>,1
> scale <0.25,1,0.25>
> translate <-0.5,0,0>
> texture { MyTexture }
> }
>
> plane
>
> y, -1
> texture { MyTexture }
> }
>
> I wish to rotate the sphere clockwise on the z axis by 180 degrees, at the same time
> translating it along the x axis by 1 unit, so that it ends up at <0.5,0,0>.
> The question is, how do I mathematically model the vertical motion so that the shape
> appears to be rolling along the plane?NOTE: I may wish to alter the scale of the
shape
> *during* the anim, so this must be taken into account in the equation.
>
> Any help appreciated.
>
> --
> ----------------------
> Andy
>
------------------------------------------------------------------------------------------
> -
> --The Home Of Lunaland--
> --visit my POV-Ray gallery--
> --listen to my music--
> www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I don't have the solutions, but I have an impression that the trig approach is a bit
contrived.
Perhaps you should be looking for a more generalized method.
The sphere is is a conic cross section (angle 90) formed by revolution. It's perfectly
described
by the math for conics. Size is derived by locating the cross section along the
vertical axis.
Using this seems fairly simple, plus it would also solve the problem of rolling
ellipsoids along
the floor. Instead of scaling, use the location of the cross section to derive the
size.
A generalized solution of this type would further yield parabolic and hyperbolic
movements.
Just an idea from my old optics days.
steve
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I posted an image and scene doing this in binaries.animations
Because of a very brute-force approach it needs the Superpatch, but unless
you have a problem with that, try it out.
Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
this seems more complicated to me, but I never studied optics, I just tutor high
school algebra and
geometry. I suppose if you could find the proper intersection of plane and cone and
find a way to
rotate it appropriately, it would work. I'm still stuck on finding a tangent to the
ellipse at any
given point on the edge of the ellipse.
I also haven't heard from Andrew in this thread, so I wonder if he has a solution or
not
Josh English
Steve wrote:
> I don't have the solutions, but I have an impression that the trig approach is a bit
contrived.
>
> Perhaps you should be looking for a more generalized method.
>
> The sphere is is a conic cross section (angle 90) formed by revolution. It's
perfectly described
> by the math for conics. Size is derived by locating the cross section along the
vertical axis.
> Using this seems fairly simple, plus it would also solve the problem of rolling
ellipsoids along
> the floor. Instead of scaling, use the location of the cross section to derive the
size.
>
> A generalized solution of this type would further yield parabolic and hyperbolic
movements.
>
> Just an idea from my old optics days.
>
> steve
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh English <eng### [at] spiritone com> wrote in message
news:371DF98C.F2D77DC2@spiritone.com...
> this seems more complicated to me, but I never studied optics, I just tutor high
school
algebra and
> geometry. I suppose if you could find the proper intersection of plane and cone and
find
a way to
> rotate it appropriately, it would work. I'm still stuck on finding a tangent to the
ellipse at any
> given point on the edge of the ellipse.
> I also haven't heard from Andrew in this thread, so I wonder if he has a solution or
not
I'm here. No, I have no solution ( I've yet to look at Margus's method ). I know so
little
about mathematics it's embarrasing, so I'm unlikely to be able to solve the problem
myself. I didn't expect it to cause this much difficulty though..I expected someone to
post a simple line of code to handle the vertical motion relative to the rotation. I
can
handle everything else with no problems.
I'm not sure why it is so complicated...the radius of the ellipse goes from 1 to 0.25
and
back, and all that is needed is a way of calculating any point inbetween, dependent on
rotation. I understand *what* to do, but have zero idea about how to do it.
I appreciate greatly your endeavours,
Andy
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I got even closer! here is the code with copious notes
// basics of the shape and it's scale and rotation values
#declare x_scale = 0.25;
#declare y_scale = 1;
#declare rotation = 185;
// correction value since the atan2 function uses the
// positive x axis at the zero point and this needs the
// negative x azis as the zero point
#declare roff = 90;
// find a point on the edge of the shape based off of the rotation value
#declare centerX = cos(radians(rotation-roff))*x_scale;
#declare centerY = sin(radians(rotation-roff))*y_scale;
#declare p = <centerX,centerY,0>;
// determine the focii of the ellipse so far only allows to be on the y axis
#declare f1 = sqrt( abs( pow(x_scale,2) - pow(y_scale,2) ) );
#declare f2 = -f1;
//make points out of the foci
#declare foci1 = <0,f1,0>-p;
#declare foci2 = <0,f2,0>-p;
// find the angle of lines between p --> f1, and p --> f2
#declare a1 = degrees(atan2(foci1.x,foci1.y));
#declare a2 = degrees(atan2(foci2.x,foci2.y));
// find the bisector of these two angles
#declare a3 = (a1 + a2)/2;// midangle
// draw everyting
plane { y, 0 pigment { checker } }
sphere { <0,0,0> 1 // okay I c
pigment { radial frequency 8 rotate 90*x}
scale <x_scale,y_scale,1>
translate -p // adjust so p is at the origin
rotate a3*z // rotate to fit on floor
}
Now for the final trick: Movingit across the floor.
Andrew Cocker wrote:
> Hi,
>
> Starting with the following code:
>
> sphere {
> <0,0,0>,1
> scale <0.25,1,0.25>
> translate <-0.5,0,0>
> texture { MyTexture }
> }
>
> plane
>
> y, -1
> texture { MyTexture }
> }
>
> I wish to rotate the sphere clockwise on the z axis by 180 degrees, at the same time
> translating it along the x axis by 1 unit, so that it ends up at <0.5,0,0>.
> The question is, how do I mathematically model the vertical motion so that the shape
> appears to be rolling along the plane?NOTE: I may wish to alter the scale of the
shape
> *during* the anim, so this must be taken into account in the equation.
>
> Any help appreciated.
>
> --
> ----------------------
> Andy
>
------------------------------------------------------------------------------------------
> -
> --The Home Of Lunaland--
> --visit my POV-Ray gallery--
> --listen to my music--
> www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh, let me locate some stuff on the web for you. The tangent to any point of any
conic cross section
is pretty standard stuff. In Jean Texareau's "How To Make A Telescope" he describes
the whole thing in
geometrical terms, so you might feel right at home. The math is differential calculus
but it is
accompanied with very clear illustrations of the various geometries of the conics and
all their
properties. You can simply examine the drawings and pick the equations you need. No
need to learn
calculus - you already know how to solve an equation. Spherics, hyperbolics,
parabolics and elliptics
are all covered. Also, the book is intended to be a primer for the amateur telescope
maker so the
presentation is easy to understand.
I'm vacationing at the lake house or I'd just grab my copy and give you the answer.
I'll be home in
about a month if the web search doesn't turn up the info.
I really believe that conics holds the key to a generalized solution to your very
interesting problem!
Once the equations are set up, you should be able to roll any conic cross section
across the floor by
altering a couple of variables. We do something very similar to this when testing and
figuring a
mirror. We measure the intersection of the conic and the light path which yields the
slope, then
calculate which conic we have. The slope is defined as being the intersection point of
a plane that is
perpendicular to the surface of the conic at that point. The ratio of the changing
slopes gives us a
scaling effect, is the ellipsoid size 1 or size 2? You can probably use this to keep
the ellipse in
constant, perfect contact with the ground plane because you'll know exactly what size
the ellipse is
and what it's slope is at every point.
The math also includes calculating the difference between a conic and a spheric, but I
don't think you
can achieve true conics simply by scaling a sphere.
I'll get back to ya on this.
steve
Josh English wrote:
> this seems more complicated to me, but I never studied optics, I just tutor high
school algebra and
> geometry. I suppose if you could find the proper intersection of plane and cone and
find a way to
> rotate it appropriately, it would work. I'm still stuck on finding a tangent to the
ellipse at any
> given point on the edge of the ellipse.
> I also haven't heard from Andrew in this thread, so I wonder if he has a solution or
not
>
> Josh English
>
> Steve wrote:
>
> > I don't have the solutions, but I have an impression that the trig approach is a
bit contrived.
> >
> > Perhaps you should be looking for a more generalized method.
> >
> > The sphere is is a conic cross section (angle 90) formed by revolution. It's
perfectly described
> > by the math for conics. Size is derived by locating the cross section along the
vertical axis.
> > Using this seems fairly simple, plus it would also solve the problem of rolling
ellipsoids along
> > the floor. Instead of scaling, use the location of the cross section to derive the
size.
> >
> > A generalized solution of this type would further yield parabolic and hyperbolic
movements.
> >
> > Just an idea from my old optics days.
> >
> > steve
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
http://www.geom.umn.edu/docs/reference/CRC-formulas/node26.html
Section 7.3 Additional Properties of Ellipses
This information is kinda condensed but it contains the illustrated answer to your
problem. You may want
to visit the section on conic basics to get warmed up.
Consider a triangle where 1 vertex is the center of the ellipse C, 1 vertex is a focus
of the ellipse F
and the 3rd vertex is point P on the circumference of the ellipse. These are derived
from a listed
equation.
The natural motion for an ellipse is to sweep equal area with equal time. The tutorial
does not show
this, but that's Kepler's 3rd Law of Planetary Motion.
Start with line C-P to be at right angle to line C-F. Point P is where the ellipse
touches the floor.
Line C-P is the distance from the center to the floor. Rotate the ellipse by a given
amount, say 5
degrees, in time T. This changes the angle of line CP by 5 degrees over time period T.
This also moves P
to point P2. Use the polar formula to find the length of C-P2 and calculate the area
of the triangle
P-P2-C. The second movement will involve calculating the distance P2-P3 from the area
of the triangle.
The area stays the same for equal time units. This also gives you the linear movement
across the floor,
which is also cyclic.
Another way to locate P2 is to rotate the ellipse by 5 degrees over time T. This tilts
line C-P as well
as line C-F 5 degrees in relation to the floor. Use a triangle with vertex F1, vertex
F2 and vertex P,
which is perpendicular to the line F1-C-F2. The angle of coincidence equals the angle
of reflection, so
changing the angle of F1-P also changes the angle of F2-P by the same amount. Use your
regular trig to
locate the new point P2 so that the angle of coincidence remains equal to the angle of
reflectance with
the floor. The length C-P tells you how far the center is from the floor and tilting
the angle of the
line C-P to perpindicular will give you the translation amount parallel to the floor.
All of the equations used are derived from 1 master equation that describes all
conics. The circle is
just a special case of the ellipse, so if you wanted to get really cute you could have
a sphere morphing
into an ellipse while rolling across the floor.
I'm busy on a programming project but I'd sure enjoy working this out. I am now
convinced it will work
for all possible conics.
steve
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thanks, Steve. Luckily I found a method of rolling the scaled sphere, which does make
an ellipse, around
the origin. What I need now is a method for finding the length of an arc on an
ellipse. I've found
equations, but they don'tmake much sense to me. I'm still working on it, though. The
arc length is the
last thing I need to finish the problem.
I wonder if Andrew Cocker has the solution as is simply testing me : ) I know I'll be
making a tutorial
about this one!
Josh
Steve wrote:
> Josh, let me locate some stuff on the web for you. The tangent to any point of any
conic cross section
> is pretty standard stuff. In Jean Texareau's "How To Make A Telescope" he describes
the whole thing in
> geometrical terms, so you might feel right at home. The math is differential
calculus but it is
> accompanied with very clear illustrations of the various geometries of the conics
and all their
> properties. You can simply examine the drawings and pick the equations you need. No
need to learn
> calculus - you already know how to solve an equation. Spherics, hyperbolics,
parabolics and elliptics
> are all covered. Also, the book is intended to be a primer for the amateur telescope
maker so the
> presentation is easy to understand.
>
> I'm vacationing at the lake house or I'd just grab my copy and give you the answer.
I'll be home in
> about a month if the web search doesn't turn up the info.
>
> I really believe that conics holds the key to a generalized solution to your very
interesting problem!
> Once the equations are set up, you should be able to roll any conic cross section
across the floor by
> altering a couple of variables. We do something very similar to this when testing
and figuring a
> mirror. We measure the intersection of the conic and the light path which yields the
slope, then
> calculate which conic we have. The slope is defined as being the intersection point
of a plane that is
> perpendicular to the surface of the conic at that point. The ratio of the changing
slopes gives us a
> scaling effect, is the ellipsoid size 1 or size 2? You can probably use this to keep
the ellipse in
> constant, perfect contact with the ground plane because you'll know exactly what
size the ellipse is
> and what it's slope is at every point.
>
> The math also includes calculating the difference between a conic and a spheric, but
I don't think you
> can achieve true conics simply by scaling a sphere.
>
> I'll get back to ya on this.
>
> steve
>
> Josh English wrote:
>
> > this seems more complicated to me, but I never studied optics, I just tutor high
school algebra and
> > geometry. I suppose if you could find the proper intersection of plane and cone
and find a way to
> > rotate it appropriately, it would work. I'm still stuck on finding a tangent to
the ellipse at any
> > given point on the edge of the ellipse.
> > I also haven't heard from Andrew in this thread, so I wonder if he has a solution
or not
> >
> > Josh English
> >
> > Steve wrote:
> >
> > > I don't have the solutions, but I have an impression that the trig approach is a
bit contrived.
> > >
> > > Perhaps you should be looking for a more generalized method.
> > >
> > > The sphere is is a conic cross section (angle 90) formed by revolution. It's
perfectly described
> > > by the math for conics. Size is derived by locating the cross section along the
vertical axis.
> > > Using this seems fairly simple, plus it would also solve the problem of rolling
ellipsoids along
> > > the floor. Instead of scaling, use the location of the cross section to derive
the size.
> > >
> > > A generalized solution of this type would further yield parabolic and hyperbolic
movements.
> > >
> > > Just an idea from my old optics days.
> > >
> > > steve
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh English wrote in message <371F3EEC.1DF566CE@spiritone.com>...
>Thanks, Steve. Luckily I found a method of rolling the scaled sphere, which
does make an ellipse, around
>the origin. What I need now is a method for finding the length of an arc on
an ellipse. I've found
>equations, but they don'tmake much sense to me. I'm still working on it,
though. The arc length is the
>last thing I need to finish the problem.
>
Why do you need the length af an arc? The tangency point problem was the
only one I had. If you've solved that, the circumference formula gives the
forward motion along the ellipse. If you look at my anim, you can see that
there is no "gliding", the ellipsoid rolls correctly.
Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Steve <ste### [at] puzzlecraft com> wrote in message
news:371F17F2.58153A54@puzzlecraft.com...
>
<snip>
>The circle is
> just a special case of the ellipse, so if you wanted to get really cute you could
have a
sphere morphing
> into an ellipse while rolling across the floor.
The above describes precisely what I wanted to be able to do. Keep up the good work
fellas.
BTW, I don't understand a word of what you're talking about ;-)
Andy
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh English <eng### [at] spiritone com> wrote in message
news:371F3EEC.1DF566CE@spiritone.com...
<snip>
> I wonder if Andrew Cocker has the solution as is simply testing me : )
LOL ;-) No way. Anything beyond simple rotates/translates and I reach for my copy of
Colefax's AutoClck.mcr. I've forgotten most of the mathematics I learnt at school, and
thinking through problems such as this turns my brain to mush in about 5 seconds flat.
I think that when this problem is solved, offering the ability to roll any ellipse (
even
a morphing one ), an extremely usefull macro could be constructed.
Thanks Josh and Steve for your efforts.
Andrew
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I was looking in .animations, not .binaries.animation, so I didn't see your post
until today. (silly me, forgot that group was there).
But I did have an epiphany. I was trying to figure out the arc length when a
ratio of the circumference to 360 degrees compared to the ratio of x to current
angle should give me the proper distance. I'm checking that now but it works.
The only thing I haven't tested is changing the size of the sphere in the middle
of the animation
here is my code:
#version 3.1;
#include "colors.inc"
global_settings { assumed_gamma 1.0 }
// ----------------------------------------
sky_sphere { pigment { gradient y
color_map { [0.0 color blue 0.6]
[1.0 color rgb 1] } } }
light_source { <0,0,0> color rgb 1
translate <-30, 30, -30>
}
// ----------------------------------------
// clock goes from 0 to 1
#declare anim_clock = clock;
#declare x_scale = 0.25;
#declare y_scale = 1;
#declare rotation = anim_clock * 180; // only animate one half rotation for a
looping anim
#declare roff = 90;
#declare centerX = cos(radians(rotation-roff))*x_scale;
#declare centerY = sin(radians(rotation-roff))*y_scale;
#declare p = <centerX,centerY,0>;
#declare circumference = 2*pi*sqrt(( pow(x_scale,2) + pow(y_scale,2) ) / 2 );
#declare half = circumference / 2;
#declare quarter = circumference / 4;
#declare f1 = sqrt( abs ( pow(x_scale,2) - pow(y_scale,2) ) );
#declare f2 = -f1;
#declare foci1 = <0,f1,0>-p;
#declare foci2 = <0,f2,0>-p;
#declare a1 = degrees ( atan2 ( foci1.x,foci1.y));
#declare a2 = degrees ( atan2 ( foci2.x,foci2.y));
#declare a3 = ( a1 + a2 )/2;
// translate across x axis
#declare translation = circumference *rotation/360;
plane { y, 0 pigment { checker scale quarter } }
sphere { <0,0,0> 1
pigment { radial frequency 8 rotate 90*x}
scale <x_scale,y_scale,0.125>
translate -p
rotate a3*z
translate translation*x
}
camera { location <translation, y_scale, -3.5>
angle 65
right 4/3*x
look_at <translation, y_scale, 0.0>
//orthographic
}
Margus Ramst wrote:
> Josh English wrote in message <371F3EEC.1DF566CE@spiritone.com>...
> >Thanks, Steve. Luckily I found a method of rolling the scaled sphere, which
> does make an ellipse, around
> >the origin. What I need now is a method for finding the length of an arc on
> an ellipse. I've found
> >equations, but they don'tmake much sense to me. I'm still working on it,
> though. The arc length is the
> >last thing I need to finish the problem.
> >
>
> Why do you need the length af an arc? The tangency point problem was the
> only one I had. If you've solved that, the circumference formula gives the
> forward motion along the ellipse. If you look at my anim, you can see that
> there is no "gliding", the ellipsoid rolls correctly.
>
> Margus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh,
Check out the bottom of the conics web page. The equation for rotating diagonals
indirectly yields the
value you are seeking. The path that point P follows and the path length are what you
need for this
approach.
However, you can get the same information by calculating the path that the Center
point follows and it's
length. The equations for this are given directly.
If this hasn't been answered clearly by the time I get back home, I'll look it up in
Texareau's book and
post the equations.
steve
Josh English wrote:
> Thanks, Steve. Luckily I found a method of rolling the scaled sphere, which does
make an ellipse, around
> the origin. What I need now is a method for finding the length of an arc on an
ellipse. I've found
> equations, but they don'tmake much sense to me. I'm still working on it, though. The
arc length is the
> last thing I need to finish the problem.
>
> I wonder if Andrew Cocker has the solution as is simply testing me : ) I know I'll
be making a tutorial
> about this one!
>
> Josh
>
> Steve wrote:
>
> > Josh, let me locate some stuff on the web for you. The tangent to any point of any
conic cross section
> > is pretty standard stuff. In Jean Texareau's "How To Make A Telescope" he
describes the whole thing in
> > geometrical terms, so you might feel right at home. The math is differential
calculus but it is
> > accompanied with very clear illustrations of the various geometries of the conics
and all their
> > properties. You can simply examine the drawings and pick the equations you need.
No need to learn
> > calculus - you already know how to solve an equation. Spherics, hyperbolics,
parabolics and elliptics
> > are all covered. Also, the book is intended to be a primer for the amateur
telescope maker so the
> > presentation is easy to understand.
> >
> > I'm vacationing at the lake house or I'd just grab my copy and give you the
answer. I'll be home in
> > about a month if the web search doesn't turn up the info.
> >
> > I really believe that conics holds the key to a generalized solution to your very
interesting problem!
> > Once the equations are set up, you should be able to roll any conic cross section
across the floor by
> > altering a couple of variables. We do something very similar to this when testing
and figuring a
> > mirror. We measure the intersection of the conic and the light path which yields
the slope, then
> > calculate which conic we have. The slope is defined as being the intersection
point of a plane that is
> > perpendicular to the surface of the conic at that point. The ratio of the changing
slopes gives us a
> > scaling effect, is the ellipsoid size 1 or size 2? You can probably use this to
keep the ellipse in
> > constant, perfect contact with the ground plane because you'll know exactly what
size the ellipse is
> > and what it's slope is at every point.
> >
> > The math also includes calculating the difference between a conic and a spheric,
but I don't think you
> > can achieve true conics simply by scaling a sphere.
> >
> > I'll get back to ya on this.
> >
> > steve
> >
> > Josh English wrote:
> >
> > > this seems more complicated to me, but I never studied optics, I just tutor high
school algebra and
> > > geometry. I suppose if you could find the proper intersection of plane and cone
and find a way to
> > > rotate it appropriately, it would work. I'm still stuck on finding a tangent to
the ellipse at any
> > > given point on the edge of the ellipse.
> > > I also haven't heard from Andrew in this thread, so I wonder if he has a
solution or not
> > >
> > > Josh English
> > >
> > > Steve wrote:
> > >
> > > > I don't have the solutions, but I have an impression that the trig approach is
a bit contrived.
> > > >
> > > > Perhaps you should be looking for a more generalized method.
> > > >
> > > > The sphere is is a conic cross section (angle 90) formed by revolution. It's
perfectly described
> > > > by the math for conics. Size is derived by locating the cross section along
the vertical axis.
> > > > Using this seems fairly simple, plus it would also solve the problem of
rolling ellipsoids along
> > > > the floor. Instead of scaling, use the location of the cross section to derive
the size.
> > > >
> > > > A generalized solution of this type would further yield parabolic and
hyperbolic movements.
> > > >
> > > > Just an idea from my old optics days.
> > > >
> > > > steve
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi Josh,
Thanks for your help. I rendered the code you posted, and it's almost perfect,
however
the ellipse seems to slide backwards a little, half way through the rotation.
Sorry for being critical ;-)
----------------------
Andy
------------------------------------------------------------------------------------------
-
--The Home Of Lunaland--
--visit my POV-Ray gallery--
--listen to my music--
www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I'm not seeing it go backwards at all, it does not move by very much but it rotates by
a large
amount when the small ends are touching the ground. It' accurate movement, tho. Very
strange
Josh
Andrew Cocker wrote:
> Hi Josh,
>
> Thanks for your help. I rendered the code you posted, and it's almost perfect,
however
> the ellipse seems to slide backwards a little, half way through the rotation.
> Sorry for being critical ;-)
>
> ----------------------
> Andy
>
------------------------------------------------------------------------------------------
> -
> --The Home Of Lunaland--
> --visit my POV-Ray gallery--
> --listen to my music--
> www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Josh English <eng### [at] spiritone com> wrote in message
news:3720FB73.29BE83C3@spiritone.com...
> I'm not seeing it go backwards at all, it does not move by very much but it rotates
by a
large
> amount when the small ends are touching the ground. It' accurate movement, tho. Very
strange
I rendered the code you posted, which had a side-on view, and it's definitely
happening .
Having seen the movie you posted from a different angle, it's much less noticeable,
although I can still see it.
all the best,
----------------------
Andy
------------------------------------------------------------------------------------------
-
--The Home Of Lunaland--
--visit my POV-Ray gallery--
--listen to my music--
www.acocker.freeserve.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |