POV-Ray : Newsgroups : povray.advanced-users : shadows and transparent textures (transparency map) : Re: shadows and transparent textures (transparency map) Server Time
28 Jul 2024 14:31:02 EDT (-0400)
  Re: shadows and transparent textures (transparency map)  
From: uwe
Date: 15 Mar 2005 04:45:00
Message: <web.4236adbb5191627373b827db0@news.povray.org>
> What are you trying to do?
>
>  - Slime
>  [ http://www.slimeland.com/ ]


i write a program that reads .3DS meshes and renders them using POV-Ray. so
i have a lot of uv-mapped meshes.

here is my example rewritten with mesh2: same result!



global_settings { max_trace_level 10 }

camera {
  perspective
  location  <2, 3, 4>
  look_at   <1, 1, 0>
  angle     45
}

light_source {
  <10, 10, 10>,
  color rgb <1, 1, 1>
}

object {
  mesh2 {
    vertex_vectors { 4,
      <0, 0, 0>,
      <2, 0, 0>,
      <0, 2, 0>,
      <2, 2, 0>
    }
    normal_vectors { 1,
      <0, 0, 1>
    }
    uv_vectors { 4,
      <0, 0>,
      <1, 0>,
      <0, 1>,
      <1, 1>
    }
    face_indices { 2,
      <0, 1, 2>,
      <1, 2, 3>
    }
    normal_indices { 2,
      <0, 0, 0>,
      <0, 0, 0>
    }
    uv_indices { 2,
      <0, 1, 2>,
      <1, 2, 3>
    }
  }
  texture {
    finish { ambient 1 diffuse 1 }
// 35.tga is an image with alpha channel of the number "35" on a fully
transparent background.
    pigment { uv_mapping image_map { tga "35.tga" interpolate 2 }  }
  }
}

object {
  plane { <0, 1, 0>, 0 }
  texture {
    finish { ambient 1 diffuse 1 }
    pigment { color rgbft <0.4, 0.4, 1, 0, 0> }
  }
}

// note that the shadow cast by the mesh2 on the plane is the outline of the
mesh2, not the outline of the number "35"
// note if you remove the "uv_mapping" modifier the shadow will be correct
but the texture will not be mapped correctly


Post a reply to this message

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