|
|
Hi !
I'm sorry for my English level...
I'm a student in the media production field and I have to create an animation
which consist of animate balls. For the moment, I just want to make a video
where two balls are about to collide, but one of the balls dodge the other.
The problem is that I can't do that.
I try to get the different between the 2 balls position. The problem is that the
result value's is sometimes 0, so in my equation, it don't work...
Have you some suggestions for me please ?
Thank's !
Here is the program :
#version 3.7;
#include "colors.inc"
#include "textures.inc"
#declare BARRE = cylinder {<0, 0, 0> <0, 10, 0> 0.05 }
#declare Epaisseur=1;
//Formes
#declare BILLE = sphere { <0, 0, 0> Epaisseur };
//Materiaux
#declare ROUGE = material { texture { pigment { Red } } };
#declare VERT = material { texture { pigment { Green } } };
#declare BLEU = material { texture { pigment { Blue } } };
//Habllage
#declare BARREX = object { BARRE material { ROUGE } };
#declare BARREY = object { BARRE material { VERT } };
#declare BARREZ = object { BARRE material { BLEU } };
#declare BILLER = object { BILLE material { ROUGE } };
#declare BILLEG = object { BILLE material { VERT } };
//Assemblage
#declare REPERE = union
{
object { BARREX rotate <0, 0, -90> }
object { BARREY }
object { BARREZ rotate <90, 0, 0> }
}
//Scene
plane {y,0 pigment {checker pigment {Black}, pigment {White} } }
object { REPERE }
//Annimation
#declare POS_G = <0, 1, -12+20*clock>;
#declare POS_R = <-10+20*clock, 1, -2>;
#declare Diff = POS_G.x - POS_R.x;
#if ( abs(Diff.x) < 4*Epaisseur )
#declare POS_G = <POS_G.x+(1/Diff.x+1), POS_G.y, POS_G.z>;
#end
// Mise en scene
object { BILLER translate POS_R}
object { BILLEG translate POS_G}
camera {
location <0, 10, 5>
look_at <0, 0, 0>
angle 90
}
light_source {
<1, 8, 1>
White*0.7
}
Post a reply to this message
|
|
|
|
On 06/01/2018 02:40 PM, Saxoalex wrote:
> Hi !
> //Annimation
> #declare POS_G = <0, 1, -12+20*clock>;
> #declare POS_R = <-10+20*clock, 1, -2>;
> #declare Diff = POS_G.x - POS_R.x;
> #if ( abs(Diff.x) < 4*Epaisseur )
> #declare POS_G = <POS_G.x+(1/Diff.x+1), POS_G.y, POS_G.z>;
try
#declare Diff = vlength(POS_G - POS_R);
#debug concat("Longueur = ", str(Diff,0,2), "\n")
--
dik
Rendered 328976 of 330000 (99%)
Post a reply to this message
|
|