From: Bruce S. <Bru...@nc...> - 2011-10-14 18:39:23
|
Your program is too long and complex for me to comment on the speed issues. Concerning color, I'm not sure exactly what your issue is. You can calculate colors and then use them; for example you could do something like mycolor = (1,1,k*z), where k*z is between 0 and 1, and then set some object's color attribute to mycolor. Also note that the faces object lets you specify the colors of all vertices individually. A general comment about speed is that if you can structure a program to use the parallelism of numpy arrays you can get large speedups in the computations. Among the example programs that use this technique are gas, stars, and toroid_drag. However, numpy can be rather hard to use. Bruce Sherwood On Fri, Oct 14, 2011 at 2:22 AM, Poul Riis <Pou...@sk...> wrote: > Now it works! (please try my further developed example below). > However, it is far too slow. > Is there any possibility to speed it up? > How can I add colors depending on the z-value? > > Poul Riis > |