POV-Ray : Newsgroups : povray.advanced-users : picking pigments from an uv-mapping Server Time
23 Dec 2024 02:09:35 EST (-0500)
  picking pigments from an uv-mapping (Message 1 to 4 of 4)  
From: MichaelJF
Subject: picking pigments from an uv-mapping
Date: 3 Mar 2013 14:05:00
Message: <web.51339e6c3a80964f83ca13760@news.povray.org>
Hi to the crowd,

I fear the answer to my question is no, but I will ask anyway. Is there a way to
get the color of a given point of a mesh2 (traced e.g.) defined by its
uv-mapping? With procedural textures it is possible using the eval_pigment
function. But is there a trick to extent it to uv-mappings?

Best regards,
Michael


Post a reply to this message

From: Alain
Subject: Re: picking pigments from an uv-mapping
Date: 3 Mar 2013 14:40:37
Message: <5133a735$1@news.povray.org>

> Hi to the crowd,
>
> I fear the answer to my question is no, but I will ask anyway. Is there a way to
> get the color of a given point of a mesh2 (traced e.g.) defined by its
> uv-mapping? With procedural textures it is possible using the eval_pigment
> function. But is there a trick to extent it to uv-mappings?
>
> Best regards,
> Michael
>
>

Not sure if it works, but you can try this:
1 - Trace to the point on the mesh you want.
2 - Use eval_pigment with the returned point.

Another possibility would be to map back the UV coordinates of the mesh 
to the original pigment, and evaluating that pigment. The trick is to 
properly interpolate your location.

It don't mather if the mesh is a mesh or mesh2, internaly, they are 
identical.
If it don't work, it's probable that it can't be done.


Alain


Post a reply to this message

From: Samuel Benge
Subject: Re: picking pigments from an uv-mapping
Date: 3 Mar 2013 15:15:01
Message: <web.5133ae95b700b43eb737415a0@news.povray.org>
Alain <kua### [at] videotronca> wrote:
>
> Another possibility would be to map back the UV coordinates of the mesh
> to the original pigment, and evaluating that pigment. The trick is to
> properly interpolate your location.
>

From within a triangle or the entire mesh? If you are doing something like
shooting numerous rays at a mesh, then figuring out which triangles are hit
might take a while. It probably isn't impossible, just exceedingly slow.

I have a macro somewhere that interpolates between vertex normals for any point
within a triangle. The math involved isn't rocket science by any stretch, but I
can provide it if need be. (It was part of a system to generate a more-or-less
even distribution of random points on mesh data, which was in turn going to be a
demo for an .obj-to-pov-arrays converter I was working on. I should just post it
before bitrot sets in.)

Sam


Post a reply to this message

From: MichaelJF
Subject: Re: picking pigments from an uv-mapping
Date: 5 Mar 2013 13:55:01
Message: <web.51363e96b700b43e54ab7e730@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote:
> Alain <kua### [at] videotronca> wrote:
> >
> > Another possibility would be to map back the UV coordinates of the mesh
> > to the original pigment, and evaluating that pigment. The trick is to
> > properly interpolate your location.
> >
>
> From within a triangle or the entire mesh? If you are doing something like
> shooting numerous rays at a mesh, then figuring out which triangles are hit
> might take a while. It probably isn't impossible, just exceedingly slow.
>
> I have a macro somewhere that interpolates between vertex normals for any point
> within a triangle. The math involved isn't rocket science by any stretch, but I
> can provide it if need be. (It was part of a system to generate a more-or-less
> even distribution of random points on mesh data, which was in turn going to be a
> demo for an .obj-to-pov-arrays converter I was working on. I should just post it
> before bitrot sets in.)
>
> Sam

Thank you both for your answers. As all I understood so far, eval_pigment will
not help since it needs a procedural pigment function, which stands alone. An
uv-mapping is ever associared to a mesh.

What I have in my mind is to have the pigment of the uv-mapping of a mesh to a
given point at the mesh (or most likely a point very close to it, which states
the next problem). The aim is to color dynamic hair from Poser due to the origin
of every single hair at the underlying mesh. One Poser hair is represented in
the derived obj-file as a so called line. This lines can be converted into
individual meshes for every hair (interpreting them as splines). PoseRay
converts them only into one mesh containing all lines. I have found an
alternative to have a single mesh per hair. And I did a feasibilty study with
POV (and 16 GB RAM at a core I7) which showed me that I can use some one million
such short hairs at a figure. Since I will "only" need some 350.000 hairs (or
only some 200.000 displaying only the visible ones) to simulate the fur of a
cat. So I asked here since it is much more easier to paint a better uv-map with
the GIMP as the one given with the Poser cat than to find a proper procedural
pigment for a cat posed already. I don't know what it's harder, to find such a
pigment (what would make eval_pigment usable)  or to calculate the point at the
uv-map.

@Sam
This line issue is not proper handled by PoseRay due to my special needs, but it
is addressed too. There are at least two applications out there which converts
obj to POV. The best is PoseRay with all its options to change or modify the
textures (and a lot of other goodies) and than there is Wings. Both are running
under windows and - with the one or other difficulty (wine or compiling from the
sources) - under linux. Wings has a Mac OS version too. So why will you invent
the wheel again?

Thanks and best regards,
Michael


Post a reply to this message

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