Here is the final version that exports the animation.
Export["/LightCone.gif", Table[
Graphics3D[{
{
Opacity[0.1],
Table[
InfinitePlane[{0, 0, z0}, {{1, 0, 0}, {0, 1, 0}}], {z0, {-1, 0, 1}}],
Red,
Table[InfinitePlane[{0, 0, z0}, {{1, 0, 0}, {0, 1, 0}}], {z0, {-1 + (-z), -1/2 + (-z), -z, 1/2 + (-z), 1 + (-z)}}]
},
{
{
Line[{{0, 0, -1}, {0, 0, 1}}],
Opacity[0.7],
Cone[{{0, 0, -1}, {0, 0, 0}}, 1],
Cone[{{0, 0, 1}, {0, 0, 0}}, 1]
}
}
},
Axes -> True, BoxRatios -> 1,
AxesEdge -> {Automatic, {1, -1}, Automatic},
AxesStyle -> {Black, Black, Red},
AxesLabel -> {"Space (ct)\t", "\tSpace (ct)", "Time (t)\t"},
Ticks -> {Automatic, Automatic, {{-1, "1 sec in past"}, {0, "Now"}, {1, "1 sec in future"}}},
PlotRange -> 1.0],
{z, 0, 0.49, 0.01}]]
BTW this helped me solve a few problems I had:before.
- My original version was inefficient. This is much more efficient as it is using a single Graphics3D function.
- When I was using Animate I had to export as AVI, convert it to WMV and then convert to animated gif. When I exported the gif directly it would only export the first frame. Now I can export the animated gif directly.
- Lastly and most importantly I get only the forward run of the animation. When I used Animate it was generating both the forward and backward animation no matter what options I used.
One more thing, The min value in Table has to be less than the max value. (REF:Table[expr,{i,imin,imax,di}] ) This is not the case for Animate and Manipulate.
Hope this helps some other folks.
Thanks,
Sandip