Asign different color to each polygon?
-
On 18/05/2014 at 13:37, xxxxxxxx wrote:
Hi everyone,
this sounds familiar to some of you I guess, anyway I need a bump in the right direction to get me going on this.
Q1: I want to asign each polygon in a scene a color without generationg selection tags and other cumbersome stuff. Something more elegant and simple like editor colors.
And also I need to store each Polygon "ID" to "link" to the color?
Q2: Is there something like a polygon ID? or is it just a List of Vectors of each object ID?
kind regards mogh
-
On 25/05/2014 at 11:38, xxxxxxxx wrote:
A polygon is just an index into an array of 4 points (point indices actually) per entry, which are the vertices of that polygon. Look at the structure manager, that's pretty much it.
Without a selection tag as intermediary, you can't extend this lightweight structure to hold a color. Editor colors refer to the whole object.
The only ID for this polygon is its index. Note that tools may change the object topologically, which would force you to adapt the index appropriately.
-
On 26/05/2014 at 09:11, xxxxxxxx wrote:
Well, I once used a trick to assign individual colors to polygons...
You can define RGB colors as UVW values inside an UVWTag that you create for your object. This trick allows you to store colors for each of the 4 points of a polygon. To get this rendered, you need to write your own shader, that uses the UVW values as RGB values. -
On 27/05/2014 at 02:30, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Well, I once used a trick to assign individual colors to polygons...
You can define RGB colors as UVW values inside an UVWTag that you create for your object. This trick allows you to store colors for each of the 4 points of a polygon. To get this rendered, you need to write your own shader, that uses the UVW values as RGB values.Thanks for the tip.