POV-Ray : Newsgroups : povray.beta-test : uv_mapping & lathe : uv_mapping & lathe Server Time
30 Jul 2024 22:21:34 EDT (-0400)
  uv_mapping & lathe  
From: Trevor Quayle
Date: 24 Sep 2001 14:39:34
Message: <3baf7de6@news.povray.org>
3.5 beta4 Win2k

I have been toying with uv_mapping, object pattern and transparency to
create a bottle label and have come across a very odd phenomenon.  Have a
look at the output of the following code (I will also post the image in
p.b-t.b).  The two objects are identical copies but, as can be seen in the
image, operate differently depending on the view.  The lathe is basically a
very thin-walled open cylinder with a texture created using the object
pattern with transparency.  When seen from the front, the 'V' can be seen
with the rest having transparency, but does not show up in the shadow.  On
the other hand, when seen from behind, the 'V' can only be seen in the
shadow and not on the cylinder.

Also of note is that when applying a uv_mapped texture to this object,when
the lathe is created as shown with 4 pts creating both an inside and an
outside surface to the lathe,  the texture needed to be scaled 1/4 size in
the y direction to be applied to only one surface, but using a lathe with
only 2 points the the texture does not need to be scaled at all.

-tgq

Code:

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}
camera {
  location  <0,2,-2>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0,0,.5>
}
sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source{0 color rgb 1 translate <0,30,-30>}

#local FName="gothic.ttf"
#local T5=text{ttf FName,"V",1,0}
#local xMn5 = min_extent (T5);
#local xMx5 = max_extent (T5);
#local TSc5=85/(xMx5-xMn5);

#declare LT1=
union{
  object{T5 translate -xMn5-(xMx5-xMn5)/2 scale <TSc5.x,TSc5.y,1>}
  scale 1/100 translate <0.5,0.5,0>
}

#declare MLab2=
material{
  texture{uv_mapping
    pigment{
      object{LT1
        pigment{rgbf<0.98,0.94,0.90,.5>},
        pigment{rgb <1,.5,.5>}
      }
      scale <100/pi/80,1/4,1>
    }
    finish{diffuse 0.3333 ambient 0 brilliance .75}
    normal{granite .05 scale <1,2,1>}
  }
}

#declare Lab1=
difference{
  lathe{linear_spline 5,<40.001,0>,<40.001,100>,<40,100>,<40,0>,<40.001,0>}
  plane{z 0}
  plane{z 0 rotate<0,180-360*100/(2*pi*40),0>}

  material{MLab2 scale <1,100,1>}
  rotate<0,90+360*100/(4*pi*40),0>
  translate z*30
  scale 1/100
}

object{Lab1 translate -.5*x}
object{Lab1 rotate y*180 translate .5*x}

plane{y 0 pigment{rgb 1}}


Post a reply to this message

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