From: Toan T N. <nt...@ph...> - 2005-01-03 04:02:20
|
On Sunday 02 January 2005 19:45, Toan T Nguyen wrote: > Hi, I'm using the face object and I keep getting this error message about > color must be the same size as pos, but I don't know how to fix it. My > script is like this: > > pos = zeros( (nface*3,3), Float) > nor = pos > col = pos > > ## assigning pos, nor, col here > for i in range(nface) > pos[i*3]=(p1x, p1y, p1z) > nor[i*3]=(n1x, n1y, n1z) > col[i*3]=color.red > ... # similarly for i*3+1, i*3+2 > > faces(pos=pos, normal=nor, color=col) > > > It gives me the following error > > File "/usr/local/lib64/python2.3/site-packages/visual/primitives.py", > line 301, in __init__ > process_init_args_from_keyword_dictionary(self, keywords) > File "/usr/local/lib64/python2.3/site-packages/visual/primitives.py", > line 37, in process_init_args_from_keyword_dictionary > displayobject.color = keywords['color'] > ValueError: color must be the same size as pos. > > > I tried > > faces(pos=pos, normal=nor, color=col) I meant faces(pos=pos, normal=nor, color=pos) > > It gives the same error. The only thing that works is > > faces(pos=pos, normal=nor, color=color.red) > > But I want to have different color for some faces. Can somebody help? > Thanks a lot. > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |