# How to maintain a smooth surface in CDFs while playing? [duplicate]

This question already has an answer here:

I created a CDF for viewing the Möbius Band, and its generation.

https://www.dropbox.com/s/e3af0xelbbqjfhd/Cinta_Moebious_Rafa.cdf

But: 1.- When it´s PAUSED the surface is soft and you can see with quality.

2.- But when you are playing and move the segmente that generate Möbius Band, .... the band seems to be less quality, and you can see point-squares, instead a soft line in the border.

...as you can see:

How can i do to maintain the surface .... soft!!

Any option in SaveDefaults?.... to save more points???

------------- This code is edited after cormullion message f[u_] = {2 Sin[u], 2 Cos[u], 0} g[u_] = {0, Sin[u/2], Cos[u/2]} Manipulate[ Show[ ParametricPlot3D[f[u] + v g[u], {v, -1, 1}, {u, 0, 2 Pi}, PlotRange -> {-3.2, 3.2}, Axes -> True, AxesLabel -> {x, y, z}, Mesh -> None, ExclusionsStyle -> {None, Red}, PlotStyle -> Directive[Green, Opacity[0.75], Specularity[White, 20]], PerformanceGoal -> "Quality"],

  ParametricPlot3D[f[u] + v g[u], {v, -1, 1},
PlotRange -> {-3.2, 3.2}, Axes -> True, AxesLabel -> {x, y, z},
Mesh -> 1, MeshShading -> {Red, Blue}, PlotStyle -> Thick],
PerformanceGoal -> "Quality"], {u, 0, 2 \[Pi], Appearance -> "Open"},

Style[" En Verde vemos la famosa Cinta de Mobius", Darker@Green],
Style[" También vemos la barra que la genera, al ir girando su \
centro sobre el plano z=0, a la vez que la barra gira un ángulo de \
180º. Dicha barra la pintamos de dos colores para ver su \
orientación", Darker@Gray],
Style[" La Parte Azul=Parte positiva", Darker@Blue ],
Style[" La Parte Roja=Parte Negativa", Darker@Red],
Style["IMPORTANTE: Fijarse como la barra comienza cabeza arriba, \
pero, tras completar el movimineto de los 360º, llega cabeza abajo",
Darker@Orange],
Style["Creado y Diseñado por: Rafaorly@gmail.com", Darker@Blue],
SaveDefinitions -> True]


-

## marked as duplicate by Simon Woods, Ajasja, Sjoerd C. de Vries, m_goldberg, Michael E2Jun 4 '13 at 15:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Try adding PerformanceGoal -> "Quality" to your ParametricPlot3D – Simon Woods Jun 4 '13 at 13:32
Good solution!! @Simon Woods – Mika Ike Jun 4 '13 at 14:19

## 2 Answers

The best (most straightforward) way to do this is to generate a table of figures and export the table instead of the Play[] function. That way, each plot will be entirely pre-computed. In dynamic blocks, Mathematica only computes as much as it needs to. It will show a lower-quality version while playing, then increase the quality when it's paused. This is further discussed here:

http://reference.wolfram.com/mathematica/tutorial/AdvancedManipulateFunctionality.html

Just swap your

Play[plot[i],{i,1,limit}];


with

t = Table[plot[i],{i,1,limit,stepsize}];


You can then play through with

Manipulate[t[[i]],{i,1,limit,1}];


or export the table directly with

Export["videofile.avi",t];


Edit: Just to be clear, an example:

t = Table[Plot[Sin[x + a], {x, 0, 2*Pi}], {a, 0, 2*Pi, 0.1}];
Manipulate[t[[i]], {i, 1, Length[t], 1}]
Export["videofile.avi", t];

-
i can´t view the result of this. i obtain a list of plot, but no graphs, that i can view. – Mika Ike Jun 5 '13 at 8:04

Without seeing the code (is it possible to see the code in a CDF file?), it's not clear where to make the changes. I can't see the slowdown on something similar (I tried to make it complex to slow it down and go blocky but it wouldn't).

Manipulate[
Show[
ParametricPlot3D[
{(2 + s*Cos[a*t])*Cos[t],
(2 + s*Cos[a*t])*Sin[t],
s*Sin[a*t]},
{s, -1, 1},
{t, 0, 2 \[Pi]},
Lighting -> "Neutral",
PlotPoints -> 50,
ImageSize -> {500, 500},
Boxed -> False,
Mesh -> False,
Axes -> False,
PlotStyle -> Directive[
Texture[ExampleData[{"TestImage", "Lena"}]],
Specularity[1, 20]],
TextureCoordinateFunction -> ({#1, #2} &),
PerformanceGoal -> pg
],
Graphics3D[
{Red, Thick, Line[{
{(2 + -1 Cos[a*line])*Cos[line],
(2 + - 1*Cos[a*line])*Sin[line],
-1*Sin[a*line]},
{(2 + 1  Cos[a*line])*Cos[line],
(2 + 1 Cos[a*line])*Sin[line],
Sin[a*line]}
}]}]
],
{{a, 1/2}, 0, 1, .01, Appearance -> "Labeled"},
{{pg, "Speed"}, {"Speed", "Quality"}},
{line, 0, 2 Pi},
ControlPlacement -> Top]
`

-
jajaja :-)) very good!!! You are a math-progrmamer-artist1 :-) – Mika Ike Jun 4 '13 at 19:04
i have edited de first message, and copy the code, @cormullion – Mika Ike Jun 4 '13 at 19:14
@mika good work! But this question has I think been answered now... – cormullion Jun 4 '13 at 19:34
@cormulliom Yes, This question has been solved! – Mika Ike Jun 5 '13 at 8:02