3D Graphics are too slow.
- To: mathgroup at smc.vnet.net
- Subject: [mg90716] 3D Graphics are too slow.
- From: Nayeli Espinosa <nayeli_shasni at yahoo.com.mx>
- Date: Mon, 21 Jul 2008 04:28:12 -0400 (EDT)
Hi, I have some days using Mathematica and I can't get used to the programming syntax. I can plot 3D Fractal Trees but when I increase the number of iterations, my program gets to run really very slow. What can I do to optimize this code for a humanly reasonable running speed? origen = {0, 0, 0}; vi = {1, 0, 0}; vj = {0, 1, 0}; vk = {0, 0, 1}; tronco = Cylinder[{origen, vk}, 0.05]; (*tronco={Red,Line[{origen,vk}]};*) Manipulate[ transf = tronco; If[tr == False, k = 0, k = 0.5 ]; For[j = 1, j <= ite, j++, transf = {transf, Table[Rotate[ Translate[Rotate[Scale[{transf}, esc, {0, 0, 0}], phi, vi], vk], 2 Pi (i - k)/br, vk], {i, 0, br - 1}]}]; Graphics3D[{tronco, transf}], {{esc, 1, "Escalamiento (0.1 a 1) "}, 0.2, 1}, {{phi, Pi/2, "Angulo"}, 0, Pi}, {{br, 4, "Brazos"}, 2, 4, 1, RadioButton}, {{tr, False, "Torcimiento"}, {False, True}}, {{ite, 2, "Iteraciones"}, 1, 5, 1, RadioButton}]