|
|
kurtz le pirate <kur### [at] gmailcom> wrote:
>
>...
> My problem is not the geometry but its coloring.
>
> My script generates a mesh (that I can save to use later). I get for
> example this surface. it is a "3d" representation of the function
> f(z) = (-z^3 + iz^2 + 1) / (z - 1 + i)^2
>
> Without going into details and according with "Domain coloring", the
> color of each point of f(z) is defined by its argument which is an angle
> ... and which corresponds to the hue.
Hi Kurtz
Assuming your z is a complex variable with a real and imaginary part,
and that you plot the magnitude of your function as the height (along
POV-Ray's y-axis) over a complex plane with the real part along POV-
Ray's x-axis and the imaginary part along POV-Ray's z-axis then you
can use the argument (0 to 2*pi) of your function to choose a color
from a color map, like this:
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#version 3.7;
#declare Tau = 2*pi;
#declare YourMesh = mesh2 { ... }
#declare YourArgFn = function { ... };
#declare ColorWheel =
color_map {
[ 0/6 color rgb <1, 0, 0> ]
[ 1/6 color rgb <1, 1, 0> ]
[ 2/6 color rgb <0, 1, 0> ]
[ 3/6 color rgb <0, 1, 1> ]
[ 4/6 color rgb <0, 0, 1> ]
[ 5/6 color rgb <1, 0, 1> ]
[ 6/6 color rgb <1, 0, 0> ]
}
object {
YourMesh
pigment {
function { YourArgFn(x, 0, z)/Tau }
color_map { ColorWheel }
}
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> kurtz le pirate <kur### [at] gmailcom> wrote:
> >
> >...
> > My problem is not the geometry but its coloring.
> >
> > My script generates a mesh (that I can save to use later). I get for
> > example this surface. it is a "3d" representation of the function
> > f(z) = (-z^3 + iz^2 + 1) / (z - 1 + i)^2
> >
> > Without going into details and according with "Domain coloring", the
> > color of each point of f(z) is defined by its argument which is an angle
> > ... and which corresponds to the hue.
>
> Hi Kurtz
>
> Assuming your z is a complex variable with a real and imaginary part,
> and that you plot the magnitude of your function as the height (along
> POV-Ray's y-axis) over a complex plane with the real part along POV-
> Ray's x-axis and the imaginary part along POV-Ray's z-axis then you
> can use the argument (0 to 2*pi) of your function to choose a color
> from a color map, like this:
>...
Btw.:
I recommend this video for those of you that are interested in such problems:
"The 5 ways to visualize complex functions | Essence of complex analysis #3"
https://www.youtube.com/watch?v=NtoIXhUgqSk
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
|
|
On 27/11/2021 18:00, Bald Eagle wrote:
> You're doing exactly the right things for your geometry. Make sure
you get the
> normals set correctly for the smooth_triangles, so you get a nice smooth
> surface.
> Let me know if you're struggling there - I got it right a while back after
> struggling with that myself - for the Bezier patch paper, IIRC.
Yes, I would like to have information on the calculation of the normals.
> "By using the texture_list it is possible to specify a texture per
triangle or
> even per vertex in the mesh. In the latter case the three textures per
triangle
> will be interpolated. To let POV-Ray know what texture to apply to a
triangle,
> the index of a texture is added to the face_indices list, after the
face index
> it belongs to.
>
> http://www.povray.org/documentation/view/3.7.1/68/
>
> scroll down to:
>
> 1.3.2.2.3 A separate texture per triangle
Yes, separate texture per triangle with texture_list.
Seems perfect but not easy to do (for me at least).
But, looking at the previous page of the documentation i found a mesh
object with texture by triangle.
http://www.povray.org/documentation/view/3.7.1/67/
This solution seems to me easier to use
On 01/12/2021 02:34, Tor Olav Kristensen wrote:
> Assuming your z is a complex variable with a real and imaginary part,
> and that you plot the magnitude of your function as the height (along
> POV-Ray's y-axis) over a complex plane with the real part along POV-
> Ray's x-axis and the imaginary part along POV-Ray's z-axis then you
> can use the argument (0 to 2*pi) of your function to choose a color
> from a color map, like this:
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #version 3.7;
>
> #declare Tau = 2*pi;
>
> #declare YourMesh = mesh2 { ... }
>
> #declare YourArgFn = function { ... };
>
Yes of corse. Is an elegant solution to this problem.
It's the same thing that bugman123 use.
YourArgFn() ... I can't define and use this function correctly.
I will start with the solution found in doc 1.3.2.1 Mesh Object.
I'll keep you informed.
Thanks you for your help and suggestions.
--
Kurtz le pirate
Compagnie de la Banquise
Post a reply to this message
|
|