To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.rayOpen lugnet.cad.ray in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Ray-Tracing / 54
53  |  55
Subject: 
Re: Pentapterigoid Star Fighter wallpaper
Newsgroups: 
lugnet.cad.ray
Date: 
Wed, 15 Dec 1999 01:42:19 GMT
Viewed: 
1182 times
  
In lugnet.cad.ray, John VanZwieten writes:
Bram, could you please describe how to map an image to a rectangle in POV?
Maybe a bit of pov-code as an example?

Basically, all you have to do is add this in the texture:

pigment { image_map { tga "filename.tga" } }

You can replace "tga" with any other file format that POV-Ray recognizes.
To make things easy, I just mapped the images to 1x1 squares[1], and then
rotated and translated the squares to form a box.  I unioned all the squares
together, and then scaled the entire box to the right dimensions.
The entire box object follows (notice that it has four sides, not just three.
That was to make sure the shadows turned out correctly.)  Because of LDraw's
(and subsequently, L3P's) different coordinate axes[2], I had to reflect the
images (ie, note the scale x*-1)
--Bram

1) actually, when I was brushing up on polygon syntax, I noticed that they
mapped an image to a rectangle as an example.  I just immitated.
2) which I was using a) because I'm used to it and b) because that's what
coordinate system the floor I had made earlier used.


//----------------Begin box---------
object {
   union {
      polygon {
        4,
        <0, 0>, <0, 1>, <1, 1>, <1, 0>
        texture {
                finish { ambient AMB diffuse DIF }
                pigment { image_map { tga "6888box_front.tga" } scale x*-1 }
        }
      }
      polygon {
        4,
        <0, 0>, <0, 1>, <1, 1>, <1, 0>
        texture {
                finish { ambient AMB diffuse DIF }
                pigment { image_map { tga "6888box_side.tga" } scale x*-1
                     rotate z*90 }
        }
        rotate y*90
        translate x*1
      }
      polygon {
        4,
        <0, 0>, <0, 1>, <1, 1>, <1, 0>
        texture { finish { ambient 1 diffuse 0 } pigment { color 0 } }
        rotate y*90
      }
      polygon {
        4,
        <0, 0>, <0, 1>, <1, 1>, <1, 0>
        texture {
                finish { ambient AMB diffuse DIF }
                pigment { image_map { tga "6888box_top.tga" } scale x*-1}
        }
        rotate x*-90
        translate y*1
      }

    }
    scale <80,-60,12>

    scale 0.9
    rotate y*90
    rotate y*10
    translate z*30
    translate x*50

    translate y*24*.7
}

//-------------End box------------



Message is in Reply To:
  Re: Pentapterigoid Star Fighter wallpaper
 
Bram Lambrecht <BramL@JUNO.com> wrote in message news:FMpB0D.6wv@lugnet.com... (...) best (...) the (...) in (...) created (...) Bram, could you please describe how to map an image to a rectangle in POV? Maybe a bit of pov-code as an example? -John (...) (25 years ago, 14-Dec-99, to lugnet.cad.ray)

21 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR