POV-Ray : Newsgroups : povray.general : uv mapping triangles in mesh {} : Re: uv mapping triangles in mesh {} Server Time
19 Apr 2024 19:56:57 EDT (-0400)
  Re: uv mapping triangles in mesh {}  
From: Thomas de Groot
Date: 25 Mar 2023 05:21:13
Message: <641ebd09$1@news.povray.org>
Op 24-3-2023 om 22:36 schreef Josh English:
> Yup. uv_mapping needs to be triggered on the texture and the object to 
> work. I played with it a bit more and managed to get the torus onto each 
> triangle that has the Test texture
> 
I have bit of a problem with this:
> #declare TorusRadius = sqrt(3)/6;
> #declare Torus = torus {TorusRadius-Line, Line rotate x*90 translate 
> <0.5, TorusRadius-Line, 0>}
> 
and I got a better fit with:

#declare Line = 0.02;
#declare Torus = torus {sqrt(3)/8, Line rotate x*90 translate <0.5, 
sqrt(3)/6, 0>}

...which is less elegant but which fits better the triangle centres 
somehow. I don't know how to translate this to your solution though.

I use the following mesh to get the image (with the necessary colour 
changes which I prefer):

mesh {
  triangle {
   <0, 0, 0>, Mid, x
   uv_vectors <0, 0>, Mid, <1, 0>
   texture {Test}
  }

   triangle {
   FZero+hx, FMid+hx, FX+hx
   uv_vectors <0, 0>, Mid, <1, 0>
   texture {Test}
  }

  triangle {
   <0, 0, 0>+x, Mid+x, x+x
   uv_vectors <0, 0>, Mid, <1, 0>
   texture {Test}
  }

  texture {pigment {rgb 1}}
  translate <-1, -1, 0>
}


-- 
Thomas


Post a reply to this message


Attachments:
Download 'be_meshtest.png' (26 KB)

Preview of image 'be_meshtest.png'
be_meshtest.png


 

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