POV-Ray : Newsgroups : povray.binaries.animations : Gravity Comparison Server Time
15 Oct 2024 17:16:33 EDT (-0400)
  Gravity Comparison (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Stephen
Subject: Re: Gravity Comparison
Date: 10 May 2017 10:51:22
Message: <591328ea$1@news.povray.org>
On 5/10/2017 2:54 PM, clipka wrote:
> On my machine, I just see pitch black.
>

I get that when I open it with quick time. It plays fine on MPC-HC.

-- 

Regards
     Stephen


Post a reply to this message

From: omniverse
Subject: Re: Gravity Comparison
Date: 10 May 2017 17:20:01
Message: <web.591382d3f6e11aaf9c5d6c810@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> On my machine, I just see pitch black.

Same here. Win10 Movies & TV player, or WMP which also freezes and must "end
task" on that.


Post a reply to this message

From: dick balaska
Subject: Re: Gravity Comparison
Date: 10 May 2017 19:59:23
Message: <5913a95b$1@news.povray.org>
Am 2017-05-10 17:14, also sprach omniverse:
> clipka <ano### [at] anonymousorg> wrote:
>> On my machine, I just see pitch black.
>
> Same here. Win10 Movies & TV player, or WMP which also freezes and must "end
> task" on that.
>

My Win 8.1 vlc plays fine.
The video is a bit off-size. Windows explorer reports a frame size of 
16x160. But
$ ffprobe Gravity.mp4
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 
0x31637661), yuv444p, 1080x720, 794 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 
tbc (default)

1080x720 is pretty close to what I see it as.
-- 
dik


Post a reply to this message

From: Kenneth
Subject: Re: Gravity Comparison
Date: 11 May 2017 10:30:00
Message: <web.591473e2f6e11aaf883fb31c0@news.povray.org>
My Windows 7's  default "Windows Media Player" doesn't play it, but it plays
fine in SMplayer (the GUI version of Mplayer.)

Yes, now it's time to add some bouncing. I haven't done that yet with any of my
own animations, but it would *seem* to be not-too-difficult. I guess the
simplest idea would be to use the same gravity-accelleration code you already
have, then reverse(?) it for the upward part of the bounce--then cycle those two
motions, with maybe just a decreasing height each time. (Of course, this dosn't
take into account any actual object 'collision' physics, but it should look nice
anyway.)

This is just a 'thought experiment', so no results are guaranteed ;-)
(That's my legal disclaimer, ha!)


Post a reply to this message

From: Bald Eagle
Subject: Re: Gravity Comparison
Date: 11 May 2017 13:15:01
Message: <web.59149c0af6e11aafc437ac910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

had the same idea when I was working on a bouncing ball animation,  but you
really only need one equation to plug the clock into.

http://feucht.us/writings/bouncing_ball.php

I never got it to work out quite the way I wanted, but all of the up and down
motion is in one equation.


Post a reply to this message

From: Stephen
Subject: Re: Gravity Comparison
Date: 11 May 2017 14:21:56
Message: <5914abc4$1@news.povray.org>
On 5/11/2017 6:14 PM, Bald Eagle wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> had the same idea when I was working on a bouncing ball animation,  but you
> really only need one equation to plug the clock into.
>
> http://feucht.us/writings/bouncing_ball.php
>
> I never got it to work out quite the way I wanted, but all of the up and down
> motion is in one equation.
>
>
>

I find that S = u*t + 0.5*a*t^2 works well enough for me. :)

As for the bounce, just reverse the velocity when the ball is less than 
its radius  from the floor. Then reduce it by a damping factor.

-- 

Regards
     Stephen


Post a reply to this message

From: Kenneth
Subject: Re: Gravity Comparison
Date: 11 May 2017 20:15:01
Message: <web.5914fe20f6e11aaf883fb31c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> had the same idea when I was working on a bouncing ball animation,  but you
> really only need one equation to plug the clock into.
>
> http://feucht.us/writings/bouncing_ball.php
>

Very interesting. While reading that article, I kept thinking of Zeno's Paradox
(running a race but never getting to the finish line.) Then the author mentions
Zeno at the end, ha!


Post a reply to this message

From: Bald Eagle
Subject: Re: Gravity Comparison
Date: 12 May 2017 08:00:00
Message: <web.5915a323f6e11aafc437ac910@news.povray.org>
Here's what I was dabbling with - there's some example code I was converting to
SDL at the end.


Not sure where my errors in coding were...


Post a reply to this message


Attachments:
Download 'bouncingball.pov.txt' (7 KB)

From: Kenneth
Subject: Re: Gravity Comparison
Date: 12 May 2017 11:25:01
Message: <web.5915d2f5f6e11aaf883fb31c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Here's what I was dabbling with - there's some example code I was
> converting to SDL at the end.
>
> Not sure where my errors in coding were...

I haven't found the problem yet, but there's a strange change in the height of
the bounces (as you've probably noticed). However, these changes are
*repetitive*, in groups of bounces (and the groups have different numbers of
bounces in them.) The first group contains 2 bounces, the second group 6, the
3rd group 6; it's hard to discern the groupings after that, but I think they are
there, all the way to the end. (Changing some of the values in your code-- like
ball radius and the T multiplier--might help to reveal them.)

I simplified your code a bit, so I could understand it more easily. I've posted
it below, with a few notes of my own.

---------------
#version 3.7;

#include "colors.inc"

global_settings {assumed_gamma 1.0}

light_source {<10, 50, -100>  color rgb <1, 1, 1>}

// main camera
camera {
 orthographic
 location  <70, 45, -180>
 right     x*image_width/image_height
 up   y
 angle 50

look_at   <70, 45, 0>
}

/*
// closer camera, to view bounces on the right-hand side
camera {
 orthographic
 location  <100, 20, -180>
 right     x*image_width/image_height
 up   y
 angle 30

look_at   <100, 20, 0>
}
*/

#declare Rad = .2; // KEN-- ball object radius

#declare Hvel = 5;
#declare BallMass = 100;
#declare BallHeight = 100; // KEN-- changing this value *here* has no effect
#declare h0 = 10;
#declare Elasticity = 0.9;
#declare G = 32;

//#declare V = sqrt(2*G*BallHeight); // KEN--not needed

#declare Vf = sqrt(2*G*BallHeight);
#declare Vnew = Elasticity* Vf;
#declare h = pow(Vnew,2)/(2*G);

#declare MaxHeight = 100;
#declare MaxEnergy = G*MaxHeight;
#declare MaxVel = sqrt(2*G*MaxHeight);
#declare SubT = 0;
#declare Step = 0.005; // .1  KEN-- reduced, to make the balls closer
               // together in the arcs-- i.e., more balls
#declare Power = 10; // KEN-- changing this value seems to have no effect
#declare Direction = -1;
#declare LastH = MaxHeight;
#declare CurrentH = MaxHeight;
#declare Color = pigment {Green};

#for (T, 0, 70, Step) // KEN-- changed 3rd value to make additional bounces

 #if (CurrentH < 0)
  //#debug concat ("CurrentH = ", str(CurrentH, 3, 1), "\n")
  #declare Direction = 1;
  #declare CurrentH = CurrentH * Direction;
  #declare MaxHeight = MaxHeight*Elasticity;
  #declare Time = sqrt(2*MaxHeight/G);
  #declare Color = rgb <1, 0, 0>;
  #declare Power = 2;
  #declare SubT = 0;
  //#debug concat ("Direction = ", str(Direction, 3, 1), "\n")
  //#debug "\n\n*Rising \n"
 #end // end check for impact

 #if (CurrentH > MaxHeight)
  //#debug concat ("CurrentH = ", str(CurrentH, 3, 1), "\n")
  //#debug concat ("MaxHeight = ", str(MaxHeight, 3, 1), "\n")
  #declare Direction = -1;
  #declare CurrentH = MaxHeight-(CurrentH-MaxHeight);
  //#debug concat ("new CurrentH = ", str(CurrentH, 3, 1), "\n")
  #declare Color = rgb <0, 1, 0>;
  #declare Power = 2;
  #declare SubT = 0;
  //#debug concat ("Direction = ", str(Direction, 3, 1), "\n")
  //#debug "\n\n*Falling \n"
 #end

 #if (Direction = -1)
  #declare CurrentH = LastH - ( (G/2) * pow(SubT, Power));
  //#debug "Falling \n"
 #else
  #declare CurrentH = MaxHeight - (G/2) * pow(Time-SubT, Power);
  //#debug "Rising \n"
  //#debug concat( "CurrentH = ", str(CurrentH, 3, 1), "\n")
  //#debug concat( "MaxHeight = ", str(MaxHeight, 3, 1), "\n")
 #end

 sphere {0, Rad pigment {Color}
     translate <T*2, (Rad+CurrentH), 0> // KEN-- T is scaling of
                                        // horizontal distance
     }
 #declare LastH = CurrentH;
 #declare SubT = SubT + Step;
#end // end for T


Post a reply to this message

From: Bald Eagle
Subject: Re: Gravity Comparison
Date: 12 May 2017 15:15:01
Message: <web.5916088ff6e11aafc437ac910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:


> I simplified your code a bit, so I could understand it more easily. I've posted
> it below, with a few notes of my own.

Thanks  :)  It's been a while since I started working on that - and realized my
HS-level physics was , er, rusty.

It was a WIP, so as you saw, there were bits an pieces of things here and there
that weren't implemented.  "Uncommented notes"   ;)

A simple bouncing macro would be a fun toy for people to play with, I think.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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