Face to vertex data interpolation for patch interpolated colors
3 次查看(过去 30 天)
显示 更早的评论
I make a patch like so:
>> patch('verticex',xyz,'faces',conn,'faceVertexCData',c,'faceColor','flat')
In this the following is true:
>> size(xyz) == [nvertices, 3]
>> size(conn) == [nfaces, 4] % so these are quads
>> size(c,1) == nfaces
>> size(c,2) == 1;
Or in other words, I have one datavalue for the color per face and I let 'patch' figure out the color needed for each face using some colormap. This all works fine, however I want an interpolated shading (instead of flat) for the faces (and edges). It seems that I need one datavalue for the color per vertex for that, instead of one per face. Or, in other words, this must be true:
>> size(c,1) == nvertices
So the question is: is there an easy way to interpolate face data to vertex data? Of course I can think of complicated ways by first determining the center of each face, and then do a griddedinterpolant, or use a plethora of other ways. But I wondered if there is a more readymade solution for this.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!