POV-Ray : Newsgroups : povray.general : uv mapping triangles in mesh {} Server Time
28 Mar 2024 11:26:42 EDT (-0400)
  uv mapping triangles in mesh {} (Message 1 to 10 of 41)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: uv mapping triangles in mesh {}
Date: 22 Mar 2023 21:10:00
Message: <web.641ba60280c12f021f9dae3025979125@news.povray.org>
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

From: Thomas de Groot
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 09:00:26
Message: <641c4d6a@news.povray.org>
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


 

From: Bald Eagle
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 13:20:00
Message: <web.641c8945eebe912c1f9dae3025979125@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> 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

From: Bald Eagle
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 13:20:00
Message: <web.641c8a1eeebe912c1f9dae3025979125@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> 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

From: Leroy
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 17:40:00
Message: <web.641cc619eebe912cc2a84cbff712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> 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

From: Leroy
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 18:25:00
Message: <web.641cd19deebe912cc2a84cbff712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> 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

From: Bald Eagle
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 19:05:00
Message: <web.641cd9feeebe912c1f9dae3025979125@news.povray.org>
"Leroy" <whe### [at] gmailcom> 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

From: Josh English
Subject: Re: uv mapping triangles in mesh {}
Date: 23 Mar 2023 23:08:06
Message: <641d1416$1@news.povray.org>
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


 

From: Kenneth
Subject: Re: uv mapping triangles in mesh {}
Date: 24 Mar 2023 03:15:00
Message: <web.641d4cf6eebe912c9b4924336e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> 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

From: Thomas de Groot
Subject: Re: uv mapping triangles in mesh {}
Date: 24 Mar 2023 03:29:30
Message: <641d515a$1@news.povray.org>
Op 23/03/2023 om 18:15 schreef Bald Eagle:
> Thomas de Groot <tho### [at] degrootorg> 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

Goto Latest 10 Messages Next 10 Messages >>>

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