POV-Ray : Newsgroups : povray.general : Image map doesnt start at given coordinates Server Time
5 Nov 2024 07:21:11 EST (-0500)
  Image map doesnt start at given coordinates (Message 1 to 6 of 6)  
From: Florin Ochiana
Subject: Image map doesnt start at given coordinates
Date: 24 Jul 2007 04:10:01
Message: <web.46a5b36b5f494fa5d779672f0@news.povray.org>
Hi all,

I'm trying to apply an image map to a section of the wall. The image is a
door which you can see here.
http://www.evolve.ro/files/nuc_national_p.jpg

After rendering the door you can see that it is a little bit off.
http://www.evolve.ro/files/bedroom.jpg

What do I have to do to make the mapping start from the first point and not
from the middle of the area?

The code for the door is this

box{<33,1,34><33,7,37>
pigment
{ image_map
  { jpeg "./tiles/usi/nuc_national_p.jpg"
    map_type 0
  }
  scale 7
  rotate y*90
}
}

Thanks


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Image map doesnt start at given coordinates
Date: 24 Jul 2007 04:53:09
Message: <46a5bdf5$1@news.povray.org>
> What do I have to do to make the mapping start from the first point and not
> from the middle of the area?

The texture lives independentantly in 3D and does not care
to which object you apply it. So it is your responsibility
to have the texture scaled, rotated and translated so that
it fits on your object. You should be aware the the image
map originally occupies a square with side length 1, so
you will need to apply different scaling in y and z, and
translate the texture until it fits.

Actually, it is usually easier to apply the texture to a
normalized object (such as a box {0,1}), and then translate,
scale and rotate it all together. Also, your box should have
a thickness > 0 to avoid rendering artefacts.


Post a reply to this message

From: Penelope20k
Subject: Re: Image map doesnt start at given coordinates
Date: 24 Jul 2007 05:43:25
Message: <46a5c9bd@news.povray.org>
image map is extended from <0,0> to <1,1>

then if you create a box from <0.2,0.1> to <0.75,0.57> for exemple, the
image will be always centered as <0,0> to <1,1>


hence if you want an image map center then do always your object like this


method one

box {pt1, pt2
texture {
        pigment {
        image_map{myimage}
        translate -.5   // wil always centered you image to <0.5,0.5>
        scale myscale  //scale to an ppropriate scale
        translate pt3   //pt3 is the center of the face you want to texture}
should be (pt1+pt2)/2
    // note: that will translate you pigment ...not your object
}}}

or
box {  - corner , corner pigment {image_map {myimage}  translate -0.5 scale
myscale}   translate Point2  // will translate your object and as well you
pigment which as been applied on it}






web.46a5b36b5f494fa5d779672f0@news.povray.org...
> Hi all,
>
> I'm trying to apply an image map to a section of the wall. The image is a
> door which you can see here.
> http://www.evolve.ro/files/nuc_national_p.jpg
>
> After rendering the door you can see that it is a little bit off.
> http://www.evolve.ro/files/bedroom.jpg
>
> What do I have to do to make the mapping start from the first point and
not
> from the middle of the area?
>
> The code for the door is this
>
> box{<33,1,34><33,7,37>
> pigment
> { image_map
>   { jpeg "./tiles/usi/nuc_national_p.jpg"
>     map_type 0
>   }
>   scale 7
>   rotate y*90
> }
> }
>
> Thanks
>
>


Post a reply to this message

From: Penelope20k
Subject: Re: Image map doesnt start at given coordinates
Date: 24 Jul 2007 05:45:54
Message: <46a5ca52@news.povray.org>
the translate -.5  is optional ..only if you want the origin of you image to
be the center of your image ...
else the origin of you image will be 'the bottom left corner'





46a5c9bd@news.povray.org...
> image map is extended from <0,0> to <1,1>
>
> then if you create a box from <0.2,0.1> to <0.75,0.57> for exemple, the
> image will be always centered as <0,0> to <1,1>
>
>
> hence if you want an image map center then do always your object like this
>
>
> method one
>
> box {pt1, pt2
> texture {
>         pigment {
>         image_map{myimage}
>         translate -.5   // wil always centered you image to <0.5,0.5>
>         scale myscale  //scale to an ppropriate scale
>         translate pt3   //pt3 is the center of the face you want to
texture}
> should be (pt1+pt2)/2
>     // note: that will translate you pigment ...not your object
> }}}
>
> or
> box {  - corner , corner pigment {image_map {myimage}  translate -0.5
scale
> myscale}   translate Point2  // will translate your object and as well you
> pigment which as been applied on it}
>
>
>
>
>

> web.46a5b36b5f494fa5d779672f0@news.povray.org...
> > Hi all,
> >
> > I'm trying to apply an image map to a section of the wall. The image is
a
> > door which you can see here.
> > http://www.evolve.ro/files/nuc_national_p.jpg
> >
> > After rendering the door you can see that it is a little bit off.
> > http://www.evolve.ro/files/bedroom.jpg
> >
> > What do I have to do to make the mapping start from the first point and
> not
> > from the middle of the area?
> >
> > The code for the door is this
> >
> > box{<33,1,34><33,7,37>
> > pigment
> > { image_map
> >   { jpeg "./tiles/usi/nuc_national_p.jpg"
> >     map_type 0
> >   }
> >   scale 7
> >   rotate y*90
> > }
> > }
> >
> > Thanks
> >
> >
>
>


Post a reply to this message

From: Alain
Subject: Re: Image map doesnt start at given coordinates
Date: 24 Jul 2007 05:53:53
Message: <46a5cc31$1@news.povray.org>
Florin Ochiana nous apporta ses lumieres en ce 2007/07/24 04:08:
> Hi all,
> 
> I'm trying to apply an image map to a section of the wall. The image is a
> door which you can see here.
> http://www.evolve.ro/files/nuc_national_p.jpg
> 
> After rendering the door you can see that it is a little bit off.
> http://www.evolve.ro/files/bedroom.jpg
> 
> What do I have to do to make the mapping start from the first point and not
> from the middle of the area?
> 
> The code for the door is this
> 
> box{<33,1,34><33,7,37>
> pigment
> { image_map
>   { jpeg "./tiles/usi/nuc_national_p.jpg"
>     map_type 0
>   }
>   scale 7
>   rotate y*90
> }
> }
> 
> Thanks
> 
> 
Create your door starting at the origin: the bottom left corner at <0,0,0>
Apply your image_map and scale it to fit your object. The maping start from 
<0,0> to <1,1>.
Rotate and translate the door to it's final location.
Make the door distinct from it's frame.

As an added bonus, you can now rotate the door so that it can be opened.

-- 
Alain
-------------------------------------------------
   The other day I came home and a guy was jogging, naked. I asked "Why?"  He 
said "Because you came home early."
	Rodney Dangerfield


Post a reply to this message

From: Florin Ochiana
Subject: Re: Image map doesnt start at given coordinates
Date: 24 Jul 2007 10:55:01
Message: <web.46a611b7305796e5d779672f0@news.povray.org>
Thank you all for your answers.

Great idea Alain! Indeed if I start from 0,0,0 I get the correct mapping and
all I have to do is to create the right size object. This is how I did it
and works very well. And I have also an opened door. ;)


Post a reply to this message

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