POV-Ray : Newsgroups : povray.newusers : Vertex Colors in POVRay Server Time
5 Sep 2024 10:31:34 EDT (-0400)
  Vertex Colors in POVRay (Message 1 to 3 of 3)  
From: Sam No Spam
Subject: Vertex Colors in POVRay
Date: 21 Dec 2000 10:52:47
Message: <3A422746.602D4B2@example.com>
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

From: Josh English
Subject: Re: Vertex Colors in POVRay
Date: 21 Dec 2000 11:01:27
Message: <3A42297A.742D4538@spiritone.com>
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] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

From: Chris Huff
Subject: Re: Vertex Colors in POVRay
Date: 21 Dec 2000 12:44:32
Message: <chrishuff-62816E.12454121122000@news.povray.org>
In article <3A42297A.742D4538@spiritone.com>, Josh English 
<eng### [at] spiritonecom> 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] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.