|
From: Toan T N. <nt...@ph...> - 2005-01-03 03:37:24
|
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)
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.
|