Re: "Color vectors" & shading [message #37754 is a reply to message #37746] |
Wed, 21 January 2004 00:24   |
nasalmon
Messages: 33 Registered: August 2003
|
Member |
|
|
"Karl Schultz" <kschultz_no_spam@rsinc.com> wrote in message news:<100rj8ksoii7b80@corp.supernews.com>...
> "Neil" <nasalmon@onetel.net.uk> wrote in message
> news:74039481.0401201339.d26efa4@posting.google.com...
>> Does anyone know how i correctly implement "color vectors" in
>> "setProperty" to give each polygon of an object its own predetermined
>> intensity level or colour? It should be that setting "shading" = 0 in
>> "setProperty" should make it so that the colour of each polygon is
>> defined by the "colour vertex" of the first vertex of the polygon
>> connectivity. However, generally the number of "first vertices" of a
>> polygon of an object is actually less than the number of polygons.
>> That means you cant use this method to give each polygon of an object
>> a predetermined different colour - or have i missed something? It
>> seems to me that what is really needed is a colour vector for the
>> polygons not the vertices.
>
> There's no way to do this today if you have vertices that are shared between
> polygons. There isn't a polygon color vector.
>
> What you could do is make a vertex list and a connectivity list that creates
> a set of independent polygons and then set the color of all the vertices
> belonging to each polygon to the same color. Actually, you would only need
> to set the first vertex of a polygon to an actual color; the rest are
> ignored if you are doing flat shading.
>
> Obviously, if you have many polygons that used to share vertices, this will
> require more space.
>
> For example, if you have 4 vertices, A, B, C, D, that form 2 triangles with
> a shared edge, the triangles might be ABC, and DCB. If the vertices are in
> the vertex list as ABCD, the conn list would be 3 0 1 2 3 3 2 1. To make
> them independent triangles, your vertex list would be ABCDCB and the conn
> list 3 0 1 2 3 3 4 5. You would set the color of vert A (at 0) to the
> desired color and the color of vert D (at 3) to the desired color. The rest
> of the vertex colors list can be left uninitialized.
>
> It isn't very efficient, but would work well if you don't have that many
> polygons.
>
> Karl
Karl,
many thanks for your response.
It's a shame there are no polygon colour vectors. If you think about
nature and surfaces, it is the surface that has the colour. The vertex
is just a manmade mathematical entity to descibe the surfaces. I am
sure it would be the wish of graphics programmes to mimic nature as
cloesly as possible in the most efficient way.
Is the absence of polygon colour vectors a fundamental limitation of
IDL? Does OpenGL have this limitation? Would there be any plans for
RSI to introduce an efficient method in IDL to enable each polygon to
have a predetermined and unique colour/intensity?
I can certainly create an artificial polygon_connectivity for
unconnected polygons allows each polygon to have a different
intensity.
best regards, Neil
|
|
|