![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Can someone tell me what stupid thing I'm doing wrong, or if somehow
uv mapping of meshes got broken?
I'm using the latest 3.8 beta.
#version 3.8;
global_settings {assumed_gamma 1.0}
default {finish {diffuse 1}}
camera {
location <0, 0, -4>
right x*image_width/image_height
up y
look_at <0, 0, 0>
}
light_source {<0, 0, -1> rgb 1.0}
sky_sphere {pigment {rgb <0.6, 0.6, 1.0>}}
#declare Line = 0.003;
#declare Square = box {0, x+y}
#declare Torus = torus {sqrt(3)/8, Line rotate x*90 translate <0.5, sqrt(3)/4,
0>}
object {Torus pigment {rgb x}}
#declare Test2 = texture {pigment {rgb 1 }}
#declare Test = texture {pigment {object {Torus rgbt 1, rgb 0}}}
#declare Zero = <0, 0>;
#declare Mid = <0.5, sqrt(3)/2>;
#declare X = <1, 0>;
#declare FZero = <0, sqrt(3)/2>;
#declare FMid = <0.5, 0>;
#declare FX = <1, sqrt(3)/2>;
#declare hx = x/2;
mesh {
triangle {
<0, 0, 0>, x, Mid
uv_vectors <0, 0>, Mid, <1, 0>
texture {Test}
}
triangle {
FZero+hx, FMid+hx, FX+hx
uv_vectors FZero, FMid, FX
//uv_vectors X, X+Mid, Mid
texture {Test2}
}
triangle {
<0, 0, 0>+x, x+x, Mid+x
uv_vectors <0, 0>, Mid, <1, 0>
texture {Test}
}
texture {pigment {rgb 1}}
translate <-1, -1, 0>
}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Op 23-3-2023 om 02:06 schreef Bald Eagle:
> Can someone tell me what stupid thing I'm doing wrong, or if somehow
> uv mapping of meshes got broken?
>
Is something like this what you want to get?
I just changed rgbt 1 into rgb 1:
#declare Test = texture {pigment {object {Torus rgb 1, rgb y+z}}}
--
Thomas
Post a reply to this message
Attachments:
Download 'be_meshtest.pov.txt' (2 KB)
Download 'be_meshtest.png' (14 KB)
Preview of image 'be_meshtest.png'
![be_meshtest.png](/povray.general/attachment/%3C641c4d6a%40news.povray.org%3E/be_meshtest.png?ttop=441664&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas de Groot <tho### [at] degroot org> wrote:
> Op 23-3-2023 om 02:06 schreef Bald Eagle:
> > Can someone tell me what stupid thing I'm doing wrong, or if somehow
> > uv mapping of meshes got broken?
> >
>
> Is something like this what you want to get?
>
> I just changed rgbt 1 into rgb 1:
> #declare Test = texture {pigment {object {Torus rgb 1, rgb y+z}}}
>
>
> --
> Thomas
Nope. I was just playing with the white/clear pigments to see where the
triangles were, as part of my experiments/debugging.
What I was trying to do was map every triangle with the same pigment pattern.
The object pattern is defined by the object location, which is within a unit
square, and so my uv_vectors ought to tell POV-Ray to sample from that global
scene space when texturing any given triangle. But only the first triangle gets
the torus object {} texture. Everything else I've tried winds up blank.
- BW
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas de Groot <tho### [at] degroot org> wrote:
> Is something like this what you want to get?
Nope. I was just playing with the white/clear pigments to see where the
triangles were, as part of my experiments/debugging.
What I was trying to do was map every triangle with the same pigment pattern.
The object pattern is defined by the object location, which is within a unit
square, and so my uv_vectors ought to tell POV-Ray to sample from that global
scene space when texturing any given triangle. But only the first triangle gets
the torus object {} texture. Everything else I've tried winds up blank.
- BW
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Bald Eagle" <cre### [at] netscape net> wrote:
> Can someone tell me what stupid thing I'm doing wrong, or if somehow
> uv mapping of meshes got broken?
>
> I'm using the latest 3.8 beta.
>
>
>
>
> #version 3.8;
> global_settings {assumed_gamma 1.0}
> default {finish {diffuse 1}}
>
> camera {
> location <0, 0, -4>
> right x*image_width/image_height
> up y
> look_at <0, 0, 0>
> }
>
> light_source {<0, 0, -1> rgb 1.0}
> sky_sphere {pigment {rgb <0.6, 0.6, 1.0>}}
>
> #declare Line = 0.003;
>
>
>
> #declare Square = box {0, x+y}
>
>
> #declare Torus = torus {sqrt(3)/8, Line rotate x*90 translate <0.5, sqrt(3)/4,
> 0>}
>
> object {Torus pigment {rgb x}}
>
>
> #declare Test2 = texture {pigment {rgb 1 }}
>
> #declare Test = texture {pigment {object {Torus rgbt 1, rgb 0}}}
>
> #declare Zero = <0, 0>;
> #declare Mid = <0.5, sqrt(3)/2>;
> #declare X = <1, 0>;
>
> #declare FZero = <0, sqrt(3)/2>;
> #declare FMid = <0.5, 0>;
> #declare FX = <1, sqrt(3)/2>;
>
> #declare hx = x/2;
>
>
> mesh {
> triangle {
> <0, 0, 0>, x, Mid
> uv_vectors <0, 0>, Mid, <1, 0>
> texture {Test}
> }
>
> triangle {
> FZero+hx, FMid+hx, FX+hx
> uv_vectors FZero, FMid, FX
> //uv_vectors X, X+Mid, Mid
> texture {Test2}
> }
>
> triangle {
> <0, 0, 0>+x, x+x, Mid+x
> uv_vectors <0, 0>, Mid, <1, 0>
> texture {Test}
> }
>
>
>
> texture {pigment {rgb 1}}
> translate <-1, -1, 0>
> }
It doesn't do what ya want on 3.7 either.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Bald Eagle" <cre### [at] netscape net> wrote:
> Can someone tell me what stupid thing I'm doing wrong, or if somehow
> uv mapping of meshes got broken?
>
> I'm using the latest 3.8 beta.
>
>
>
>
> #version 3.8;
> global_settings {assumed_gamma 1.0}
> default {finish {diffuse 1}}
>
> camera {
> location <0, 0, -4>
> right x*image_width/image_height
> up y
> look_at <0, 0, 0>
> }
>
> light_source {<0, 0, -1> rgb 1.0}
> sky_sphere {pigment {rgb <0.6, 0.6, 1.0>}}
>
> #declare Line = 0.003;
>
>
>
> #declare Square = box {0, x+y}
>
>
> #declare Torus = torus {sqrt(3)/8, Line rotate x*90 translate <0.5, sqrt(3)/4,
> 0>}
>
> object {Torus pigment {rgb x}}
>
>
> #declare Test2 = texture {pigment {rgb 1 }}
>
> #declare Test = texture {pigment {object {Torus rgbt 1, rgb 0}}}
>
> #declare Zero = <0, 0>;
> #declare Mid = <0.5, sqrt(3)/2>;
> #declare X = <1, 0>;
>
> #declare FZero = <0, sqrt(3)/2>;
> #declare FMid = <0.5, 0>;
> #declare FX = <1, sqrt(3)/2>;
>
> #declare hx = x/2;
>
>
> mesh {
> triangle {
> <0, 0, 0>, x, Mid
> uv_vectors <0, 0>, Mid, <1, 0>
> texture {Test}
> }
>
> triangle {
> FZero+hx, FMid+hx, FX+hx
> uv_vectors FZero, FMid, FX
> //uv_vectors X, X+Mid, Mid
> texture {Test2}
> }
>
> triangle {
> <0, 0, 0>+x, x+x, Mid+x
> uv_vectors <0, 0>, Mid, <1, 0>
> texture {Test}
> }
>
>
>
> texture {pigment {rgb 1}}
> translate <-1, -1, 0>
> }
Instead of torus try
#declare Rod =cylinder{-x*10,x*10,.02 translate y*.25}
as an object pigment
It seems the object pigment is what's acting strange when used in the texture.
Try an image map.
Have fun!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Leroy" <whe### [at] gmail com> wrote:
> Instead of torus try
> #declare Rod =cylinder{-x*10,x*10,.02 translate y*.25}
> as an object pigment
>
> It seems the object pigment is what's acting strange when used in the texture.
> Try an image map.
> Have fun!
I've tested it with cylinders, spherical, onion, and spiral1.
It seems like uv_vectors has no effect at all. Which would explain why the
patterns localized to a unit square don't show up in the other triangles.
Indeed, adding scale 3 to the torus object pattern applies the scaled texture to
all 3 triangles.
This looks seriously broken.
- BW
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 3/23/2023 6:00 AM, Thomas de Groot wrote:
> Op 23-3-2023 om 02:06 schreef Bald Eagle:
>> Can someone tell me what stupid thing I'm doing wrong, or if somehow
>> uv mapping of meshes got broken?
>>
>
> Is something like this what you want to get?
>
> I just changed rgbt 1 into rgb 1:
> #declare Test = texture {pigment {object {Torus rgb 1, rgb y+z}}}
>
>
I added the uv_mapping keyword to the Test texture and got the following
result.
IS this what you're looking for?
Post a reply to this message
Attachments:
Download 'uv_test.png' (7 KB)
Preview of image 'uv_test.png'
![uv_test.png](/povray.general/attachment/%3C641d1416%241%40news.povray.org%3E/uv_test.png?ttop=441664&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Bald Eagle" <cre### [at] netscape net> wrote:
>
> Can someone tell me what stupid thing I'm doing wrong, or if somehow
> uv mapping of meshes got broken?
>
I thought the problem might be due, in some way, to the use of an 'object
pattern' for the uv texture; but no.
I appears that uv-mapping (or rather, the uv-vector coordinates) for each
*individual* triangle are not 'translate-able'. That is, when translated, they
don't affect the position of the applied texture. I ran a little animation to
see:
#declare Test = texture {pigment{gradient x+y frequency 5}}
mesh {
triangle { // [the one that lines up with both your torus object and
// torus 'object pattern']
<0, 0, 0>, x, Mid
uv_vectors <.5 +clock, 0>, Mid, <1, 0> // the texture is not
// disturbed and does not move
texture {Test}
}
....
translate <-1, -1, 0> // [this does translate everything, as expected]
}
In the docs' example at '3.6.1.7.2 UV Vectors', each triangle has uv_vectors
that are only zeros and ones; maybe that's the only way they can be written and
used? Meaning, I suppose, that they are 'global' in some sense and that the
uv-map can't be shifted per individual triangle. All just guesswork, of course.
For the results you want, I was half-way thinking that each individual use of
texture{Test} should be translated instead. But I just tried it:
triangle{...
texture{Test translate clock*x}
}
Fatal error.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Op 23/03/2023 om 18:15 schreef Bald Eagle:
> Thomas de Groot <tho### [at] degroot org> wrote:
>> Op 23-3-2023 om 02:06 schreef Bald Eagle:
>>> Can someone tell me what stupid thing I'm doing wrong, or if somehow
>>> uv mapping of meshes got broken?
>>>
>>
>> Is something like this what you want to get?
>>
>> I just changed rgbt 1 into rgb 1:
>> #declare Test = texture {pigment {object {Torus rgb 1, rgb y+z}}}
>>
>>
>> --
>> Thomas
>
> Nope. I was just playing with the white/clear pigments to see where the
> triangles were, as part of my experiments/debugging.
>
> What I was trying to do was map every triangle with the same pigment pattern.
> The object pattern is defined by the object location, which is within a unit
> square, and so my uv_vectors ought to tell POV-Ray to sample from that global
> scene space when texturing any given triangle. But only the first triangle gets
> the torus object {} texture. Everything else I've tried winds up blank.
>
Afaik, you cannot uv-map an object pattern like an image_map as that is
all about intersections of objects: your patterned object intersects the
main object or not and uses the given pigments for inside and outside.
In fact, you do not even need uv-mapping in that case. What you need is
making sure that your pattern object (i.e. the torus) interects your
primary object (i.e. the triangle) each time you invoke the texture. The
torus does not move if you do not tell it to specifically. It does not
move by a texture translate.
Afaik, this is normal behaviour. Just my two-and-a half cents
--
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |