POV-Ray : Newsgroups : povray.general : uv mapping triangles in mesh {} : uv mapping triangles in mesh {} Server Time
28 Mar 2024 11:51:02 EDT (-0400)
  uv mapping triangles in mesh {}  
From: Bald Eagle
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

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