per-vertex coloring

Hi,

For a project I'm currently working on, I'd like to convert a mesh, which is
colored on a per-vertex basis to Radiance.
Polygon seems the most likely primitive to do so, but I'm curious to know
how I can achieve per-vertex coloring in Radiance effectively. Of course,
writing a face with its colors wouldn't really work out here, since I would
need some form of interpolation of the color values between the different
faces, or things would get pretty ugly. Has anyone run into this kind of
conversion? Any pointers much appreciated!

Cheers,

-jelle

Sorry, this comes a bit late.

Greg has posted a script for plotting values with Radiance tools
recently. An extension to that was the creation of a texture and
mapping it onto the surface.

Have you considered creating a texture from your vertex colours?

Regards,
Thomas

···

On 5 Nov 2007, at 10:09, jelle feringa wrote:

Hi,

For a project I'm currently working on, I'd like to convert a mesh,
which is colored on a per-vertex basis to Radiance.

That's funny -- I didn't remember ever writing such a script, but sure enough, Thomas is right:

  http://www.radiance-online.org/pipermail/radiance-general/2005-February/002444.html

Unfortunately, even if you modified this script to render cones rather than spheres in order to get a Voronoi diagram, it wouldn't give you the kind of smooth results you are probably after.

None of the Radiance tools or converters really supports per-vertex color. However, gensurf, mgf2rad, and obj2rad all support per-vertex normals, which are substantially similar. It should be possible to pass the output of one of these programs through rcalc and convert the per-vertex normals to per-vertex colors, but it would be a very nasty-looking script that would take me an hour or two to put together.

A C-program that generates a Radiance picture you could use as a texture as Thomas suggests might even be easier to write.

-Greg

···

From: Thomas Bleicher <[email protected]>
Date: November 7, 2007 3:59:56 PM MST

On 5 Nov 2007, at 10:09, jelle feringa wrote:

Hi,

For a project I'm currently working on, I'd like to convert a mesh,
which is colored on a per-vertex basis to Radiance.

Sorry, this comes a bit late.

Greg has posted a script for plotting values with Radiance tools
recently. An extension to that was the creation of a texture and
mapping it onto the surface.

Have you considered creating a texture from your vertex colours?

Regards,
Thomas

Nice to be right at least once but I was thinking of your mail
about 'extraction of luminance values' from 17/08/2007, especially
the part with the coloured 3D plot at the end.

Reading it again it might not be that simple to apply to this
problem, though. My idea was to read the colour value and save
it to a known picture position, then assign this position as
UV-coordinate to the mesh vertex. The picture used as texture
should give the mesh the desired colouring.

What I probably had in mind was something Blender users can do:
create a mesh (example: a sphere), 'paint' a mouth, nose, eyes and
hair onto the sphere in 3D and 'unwrap' it to a texture image.
Then you can use Photoshop etc. to refine that sketchy image to
a proper face texture.

Applied here it would be:

1) get the mesh into Blender (...)
2) unwrap and save texture of vertex colours
3) export mesh to *.obj with uv-texture
4) convert texture image to *.pic
5) use obj2mesh to get shape and texture into Radiance

Regards,
Thomas

···

On 8 Nov 2007, at 00:14, Greg Ward wrote:

That's funny -- I didn't remember ever writing such a script, but sure enough, Thomas is right:

  http://www.radiance-online.org/pipermail/radiance-general/2005-February/002444.html

Hi Jelle,

I lost this thread in some e-mail difficulties I was having with my online service. These seem to be sorted out, now...

A quick look at the ra_xyz man page will confirm that this program is for converting between RGB and XYZ color space, nothing to do with the pixel coordinates on an image. (Confusing, I know.)

Is your mesh grid regular? If not, you're sort of stuck because you need to resample the colors onto a grid, which is a hard problem. If you have a grid to begin with, it may be as simple as establishing a correspondence between the local (u,v) coordinates and a dump of values into a Radiance picture (using pvalue -r ...).

If you feel like hacking C-code, the program src/hd/rhpict will take a set of point values and resample them into an image. It wouldn't take that much to get it to accept colors and positions rather than taking a holodeck as input, I don't think.

-Greg

···

---------------

Hi Thomas & Greg,

Many thanks for your suggestions here!

Thomas, the texture-based appraoch is something that came across my mind as
well.
The other thing that I was wondering about is whether the colordata
primitive might be relavant here?

For the textures based approach, probably ra_xyz is my friend here, though
I'm more wondering how I could generate the proper set of uv coordinates to
get the right mapping.
I'm not using textures in any sense, the use of per-vertex coloring is
closer to scientific data visualization.
Each vertex has a corresponding scalar value assigned to it, which is mapped
to a color value by a lookup-table, and the values of the lookup-table are
the ones I'm trying to map.

Many thanks for your suggestions!

-jelle

Nice to be right at least once but I was thinking of your mail
> about 'extraction of luminance values' from 17/08/2007, especially
> the part with the coloured 3D plot at the end.
>
> Reading it again it might not be that simple to apply to this
> problem, though. My idea was to read the colour value and save
> it to a known picture position, then assign this position as
> UV-coordinate to the mesh vertex. The picture used as texture
> should give the mesh the desired colouring.
>
> What I probably had in mind was something Blender users can do:
> create a mesh (example: a sphere), 'paint' a mouth, nose, eyes and
> hair onto the sphere in 3D and 'unwrap' it to a texture image.
> Then you can use Photoshop etc. to refine that sketchy image to
> a proper face texture.
>
> Applied here it would be:
>
> 1) get the mesh into Blender (...)
> 2) unwrap and save texture of vertex colours
> 3) export mesh to *.obj with uv-texture
> 4) convert texture image to *.pic
> 5) use obj2mesh to get shape and texture into Radiance
>
> Regards,
> Thomas