![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I am seeking a way to specify per-vertex colors in a polygon mesh in
POVRay. In OpenGL I'd do it with something like
glBegin( GL_POLYGON );
for ( p = p0; p < p1; p++ ) {
glColor4f( v_red[p], // red
v_green[p], // green
v_blue[p], // blue
1.0 ); // alpha
glNormal3f( vnx[p], vny[p], vnz[p] );
glVertex3f( x[p], y[p], z[p] );
}
glEnd();
Clues, RTFMs, and suggestions are all welcome.
Please remove the "-nospam" from the Reply-To: address if responding
directly.
Thanx.
spl
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
It isn't possible with Polygons, but Chris Colefax has a tri-color
triangle include file:
http://www.geocities.com/SiliconValley/Lakes/1434/otherincludes.html
So you would have to create a simple macro to take the polygon points
and create a group of these triangles to get it to work. I have never
worked with it myself, but based on the rest of Chris's stuff, it should
be fairly straightforward.
Josh
Sam No Spam wrote:
> I am seeking a way to specify per-vertex colors in a polygon mesh in
> POVRay. In OpenGL I'd do it with something like
>
> glBegin( GL_POLYGON );
>
> for ( p = p0; p < p1; p++ ) {
>
> glColor4f( v_red[p], // red
> v_green[p], // green
> v_blue[p], // blue
> 1.0 ); // alpha
> glNormal3f( vnx[p], vny[p], vnz[p] );
> glVertex3f( x[p], y[p], z[p] );
>
> }
>
> glEnd();
>
> Clues, RTFMs, and suggestions are all welcome.
>
> Please remove the "-nospam" from the Reply-To: address if responding
> directly.
>
> Thanx.
>
> spl
--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritone com
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3A42297A.742D4538@spiritone.com>, Josh English
<eng### [at] spiritone com> wrote:
> It isn't possible with Polygons, but Chris Colefax has a tri-color
> triangle include file:
...snip...
Also, MegaPOV has a patch that allows per-vertex textures to be applied
to triangles. A mesh using this patch is much more memory efficient than
the macro...and probably faster.
MegaPOV is available here: http://nathan.kopp.com/patched.htm
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |