Basic Examples (2)
Basic Examples
(2)
Create a simple model with a falling ball and a fixed floor:
In[7]:=
model=[{{-4,-4,0},{4,4,6}},"Thickness"->1],[{HatchShading[.6,Blue],Cuboid[{-4,-4,-1},{4,4,0}]}],[{MaterialShading["Gold"],Sphere[{0,0,5},0.6]}],
Out[7]=
PhysicsModelObject
Plot the model in its initial state:
In[8]:=
Out[8]=
Evolve the model for 300 steps with time step 1/60:
In[9]:=
frames=[model,300,1/60];
Generate a video from the frames:
In[10]:=
Out[10]=
Create a model with four balls with various levels of bounciness:
In[7]:=
model=[{{-4,-4,0},{4,4,6}},"Thickness"->1],[{HatchShading[.6,Gray],Cuboid[{-4,-4,-1},{4,4,0}]},"Restitution"->1.0],[{MaterialShading["Gold"],Sphere[{-2.5,0,5.0},0.5]},"Restitution"->0.95],[{MaterialShading["Copper"],Sphere[{-0.8,0,5.0},0.5]},"Restitution"->0.6],[{MaterialShading["Silver"],Sphere[{0.8,0,5.0},0.5]},"Restitution"->0.2],[{MaterialShading["Brass"],Sphere[{2.5,0,5.0},0.5]},"Restitution"->0.0],;
Evolve the model for 300 steps with time step 1/60:
In[8]:=
frames=[model,300,1.0/60.0];
Generate a video from the frames:
In[9]:=
Out[9]=
———————————————————————————————————————————————————————————————
Create a model with an avalanche of spheres:
In[10]:=
model=[{{-5,-5,-10},{5,5,16}}],[{Sphere[{0,0,-6},4]}],Flatten@Table[{Sphere[{i,j,k}+RandomReal[{-0.01,0.01},3],0.25]}],{i,-3,3},{j,-3,3},{k,0,14},
Out[10]=
PhysicsModelObject
Evolve the model for 300 steps with time step 1/60:
In[11]:=
frames=[model,300,1/60];
Generate a video from the frames:
In[12]:=
Out[12]=
Create a model with a dodecahedron rolling on an inclined plane:
Evolve the model for 300 steps with time step 1/60:
Generate a video from the frames:
Create a collection of "dominoes":
Create a ball that will push over the dominoes:
Create the model from the ball and dominoes:
Evolve the model for 300 steps with time step 1/60:
Generate a video from the frames:
Create a model with a large number of cones:
Evolve the model for 300 steps with time step 1/60:
Generate a video from the frames: