POV-Ray : Newsgroups : povray.general : How to display image? : Re: How to display image? Server Time
31 Jul 2024 06:24:32 EDT (-0400)
  Re: How to display image?  
From: Zeger Knaepen
Date: 18 Sep 2007 18:04:48
Message: <46f04b80$1@news.povray.org>
"Pahidla" <dol### [at] yahoocom> wrote in message 
news:web.46ef777c6a46897c3ccd3f470@news.povray.org...
> Thanks!
>
> Is there such a thing as a "rectangle", rather than a "box"?

there are polygons, and triangles.  If I want to create a rectangle, I use 
this macro:

#macro Quad(P1,P2,P3,P4)
 triangle {P1,P2,P3} triangle {P1,P3,P4}
#end

(you'll have to put this inside a mesh, like this:

mesh {
    Quad(<0,0,0>,<0,1,0>,<1,1,0>,<1,0,0>)
}

You could even add uv-coordinates, like this: (untested code!!!)

#macro Quad(P1,P2,P3,P4)
    triangle {P1,P2,P3 uv_vectors <0,0>,<0,1>,<1,1>}
    triangle {P1,P3,P4 uv_vectors <0,0>,<1,1>,<1,0>}
#end

mesh {
    Quad(<0,0,0>,<0,1,0>,<1,1,0>,<1,0,0>)
    texture {
        uv_mapping pigment {image_map {jpeg "puppy.jpg" interpolate 2}}
        finish {ambient 0 diffuse 1}
    }
}


cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

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