POV-Ray : Newsgroups : povray.advanced-users : Mesh2 and image maps Server Time
22 Dec 2024 01:29:36 EST (-0500)
  Mesh2 and image maps (Message 1 to 3 of 3)  
From: Leroy
Subject: Mesh2 and image maps
Date: 29 Feb 2020 17:40:01
Message: <web.5e5ae640f40fb85646354ef40@news.povray.org>
I was making my own Mesh2 pulleys belts. Every thing work find or so I thought.
I test the mesh2 using solid colors and color maps with Normals Finishs in a
complicated texture.
Then I found out that part of the mesh worked back on it self. When I fix that
and tried color map or image maps it froze. That is :: if you try to translate
the texture then put it on the mesh The IMAGEs don't move! But the Normals do!
I've never seen anything like it.

 I'm running 3.7 I've try it on 3.6 with the same effect.

Without getting into the code to much
The texture ::
#local BTex=array[4];
#local BTex[0]=texture{pigment{rgb<1,0,0>}
                       normal{agate scale <10/60,.05,.1>}}
#local BTex[1]=texture{pigment{rgb<0,1,0>}
                       normal{agate scale<1/50,.1,1>} }
#local BTex[2]=texture{pigment{rgb<0,0,1>} normal{agate scale<.2,1,1>}
                       finish{phong .3 phong_size 250}}
#local BTex[3]=texture{pigment{image_map{tga "Road6.tga"} scale <1/25,-.49,1>
                       translate <5,.51,0>}
                       normal{granite  scale<1,1,1>}
                       finish{phong .8 phong_size 250}}
The final texture::
#local BTexX=texture{gradient y
              texture_map{
                           [0.010284 BTex[0]]
                           [0.010284 BTex[1]]
                           [0.5 BTex[1]]
                           [0.5 BTex[2]]
                           [0.510284 BTex[2]]
                           [0.510284 BTex[3]]
                           [1 BTex[3]]
                         }
                         translate x*B_TexLoc//animation texture move
                        }

I've set the uv vectors from <0,0> to <1,1>

Anyone seen this before?


Post a reply to this message

From: William F Pokorny
Subject: Re: Mesh2 and image maps
Date: 1 Mar 2020 08:31:30
Message: <5e5bb932$1@news.povray.org>
On 2/29/20 5:39 PM, Leroy wrote:
> I was making my own Mesh2 pulleys belts. Every thing work find or so I thought.
> I test the mesh2 using solid colors and color maps with Normals Finishs in a
> complicated texture.
> Then I found out that part of the mesh worked back on it self. When I fix that
> and tried color map or image maps it froze. That is :: if you try to translate
> the texture then put it on the mesh The IMAGEs don't move! But the Normals do!
> I've never seen anything like it.
> 
...
> 
> I've set the uv vectors from <0,0> to <1,1>
> 
> Anyone seen this before?
> 
Hi Leroy,

Not here. Perhaps someone using meshes regularly understands why you see 
what you see. I'll offer guesses/rambling in the meantime - while having 
a feeling you are using the mesh uv mapping mechanism in a somewhat 
unusual way.

- In my experience the mesh image maps would point into the image, 
texture or material with uv vectors in some sort of fixed / one time 
way. Perhaps this behavior is hard coded in a way that bypasses a 
texture's modifiers for image maps? The normals you specified would be 
outside any fixed uv image mechanism - if such a thing exists. Hmm, what 
happens if you use something other than an image_map with BTex[3] - some 
gradient x pattern with vertical stripes maybe? Does that then move with 
the normals?

- It looks like the BTexX translate is in x only. Have you tried an off 
axis translation to be sure you are not hitting some sort of harmonic 
with the image movement where it happens to be the same at every B_TexLoc?

- When you say you've set the uv vectors in the mesh, I assume you mean 
you are pointing mesh vertexes at the appropriate locations in the BTexX 
texture. I suppose you're aligning those with the gradient y in some 
fashion(1).

I've played with meshes in mapping other formats into POV-Ray and doing 
simple stuff color to vertex stuff, but, my understanding of how the 
POV-Ray uv mesh mechanism 'really works' is shallow(2).

Bill P.

(1) - Find myself wondering whether uv coordinates outside the <0,0> to 
<1,1> range would work... I can't now see any reason they couldn't 
function. Suppose, I'm wondering too, if texture movement could be 
accomplished by shifting the uv vectors for each frame. Today, we reload 
everything in the scene for each frame - so should work I think, and 
even if constrained in the 0-1 range. Hmm, Could make for some 
interesting animations shifting materials/textures around on an incoming 
mesh - blurring a mesh model's materials by merging frames. Anyway...

(2) - With mesh image mapping, wondered how the mesh mapping pros handle 
an image's interpolation seams. Are appropriate extra pixels carefully 
added to the images internal edges/cut-outs to be sure any 'image' 
interpolation results in a clean texture on the mesh at those seams? 
Does such a thing happen by side effect of mesh painting - is there some 
overspray area? I'm curious if anyone knows - otherwise, someday maybe 
I'll investigate. You've mapped without POV-Ray image interpolation / 
smoothing, so my question matters not in your scene.


Post a reply to this message

From: Leroy
Subject: Re: Mesh2 and image maps
Date: 6 Mar 2020 22:10:00
Message: <web.5e630f6e6524ec49f7d4608f0@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> >
> Hi Leroy,
>
> Not here. Perhaps someone using meshes regularly understands why you see
> what you see. I'll offer guesses/rambling in the meantime - while having
> a feeling you are using the mesh uv mapping mechanism in a somewhat
> unusual way.
>

First off I want to apologize for being so late getting back here.
 And you need to know that as soon as I got off line I found the problem was all
in the way I used the image map. Before I did my 'fix' I had the uv fitted to
the mesh in a 1 to belt length style <0,0> to <1,Belt length> so any image would
fit the belt.
 After the 'fix' it was <0,0> to <1,1>, While testing, I plane forgot what I
just did and was scaling the image map to fit the old style of uv mapping.
Now I didn't use the once in the image map, so I got repeat images. And my test
values to move the texture just happen to keep the image map in the same place
but the normals where where moved!
 So now we have an new effect. When the image is frozen and the normals move you
can have gost floating across the screen. My test image was a landscape and it
made it look like clouds floating over head.

> - In my experience the mesh image maps would point into the image,
> texture or material with uv vectors in some sort of fixed / one time
> way.
Your completely  right there.

> - When you say you've set the uv vectors in the mesh, I assume you mean
> you are pointing mesh vertexes at the appropriate locations in the BTexX
> texture. I suppose you're aligning those with the gradient y in some
> fashion(1).
>
I'll answer this here and drop (1)
Your Right in what I did. I wrapped the uv mapping around a belt so that each
face of the belt match one of the textures in BTexX.

> I've played with meshes in mapping other formats into POV-Ray and doing
> simple stuff color to vertex stuff, but, my understanding of how the
> POV-Ray uv mesh mechanism 'really works' is shallow(2).
>
> Bill P.
>
> (2) - With mesh image mapping, wondered how the mesh mapping pros handle
> an image's interpolation seams. Are appropriate extra pixels carefully
> added to the images internal edges/cut-outs to be sure any 'image'
> interpolation results in a clean texture on the mesh at those seams?
> Does such a thing happen by side effect of mesh painting - is there some
> overspray area? I'm curious if anyone knows - otherwise, someday maybe
> I'll investigate. You've mapped without POV-Ray image interpolation /
> smoothing, so my question matters not in your scene.

 I haven't used many other Mesh making programs. Blender the one that comes to
mind and I never did get into the image mapping part. I have seen some of the
images used by other Mesh programs. They are always tied to a single mesh.

Thanks for you thoughts.
Have Fun


Post a reply to this message

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