[scilab-Users] Plot3d1 with spheres in diffrent colors, how?

Constellation Athome constellationathome at googlemail.com
Mon Jan 30 14:10:36 CET 2012


Hi Calixte,

thank you for the code snippet. It works well, but may I ask another
question?
I want to "turn" the plot with alpha and theta angle. I want to do that to
take screencapters from each position for an animation.  but when I do that
with a simple for and try to plot them, the colors are not there or every
sphere has the same color.
could you please tell me how to achieve that?

best regards,

Andreas

2012/1/29 Calixte <calixte.denizet at scilab-enterprises.com>

> **
> On 29/01/2012 20:06, Constellation Athome wrote:
>
> Hi there,
>
>
> Hi,
>
> In taking the example given in plot3d.html, you can make something like:
>
> deff("[x,y,z]=sph(alp,tet)",["x=r*cos(alp).*cos(tet)+orig(1)*ones(tet)";..
>      "y=r*cos(alp).*sin(tet)+orig(2)*ones(tet)";..
>      "z=r*sin(alp)+orig(3)*ones(tet)"]);
> r=1; orig=[0 0 0];
> [xx,yy,zz]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));
> clf();
> plot3d(xx,yy,zz)
> plot3d(xx,yy,zz + 2.5)
>
> a=gca();
> a.children(1).color_mode = 3;
> a.children(2).color_mode = 5;
>
> You should have a look at:
> http://help.scilab.org/docs/5.3.3/en_US/surface_properties.html
>
> Regards,
>
> Calixte
>
>
>
>
> I would like to give each sphere in my plot3d1 plot a different color so
> that I can distinguish them better.
> I played around with http://help.scilab.org/docs/5.3.3/en_US/plot3d.htmlbut couldn't find a way to change it to rgb colours or whatever, to have a
> red, a green and another colour.
>
> It would be great, if you could help me.
> And another question is, how to add opacity so that they will be
> translucent.
>
> Thanks in advance,
>
> Andreas
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120130/a05886c6/attachment.htm>


More information about the users mailing list