POV-Ray : Newsgroups : povray.newusers : Using an image file : Re: Using an image file Server Time
18 Apr 2024 23:07:07 EDT (-0400)
  Re: Using an image file  
From: Kenneth
Date: 10 Jul 2017 01:45:00
Message: <web.5963131fbbe238b1883fb31c0@news.povray.org>
A simple example would be this code (assuming you already have a camera and some
lights in the scene). It uses the 'image_map' keyword...


#version 3.7;  // or 3.6, or whichever version of POV-Ray you are using

global_settings{assumed_gamma 1.0 max_trace_level 5}

---(camera here)---

-- light(s) here---

box{<0,0,0>, <1,1,0> // a box can be made zero-thickness if you want
    texture{
        pigment{
            image_map{jpeg "my_image.jpg" interpolate 2}
               }
        finish{ambient .2 emission 0 diffuse .8}
           }
        scale... // scales the full box object, not just the image.
// ANY image is 'squashed' or 'stretched' to completely fill the
// 1X1-unit box, by default, no matter what its resolution or aspect-ratio
// is-- so you will probably need to scale the box to the proper ratio.
        translate ... // ditto, wherever you want it to be in space
   }


Post a reply to this message

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