POV-Ray : Newsgroups : povray.newusers : image map Server Time
27 Sep 2024 01:14:21 EDT (-0400)
  image map (Message 8 to 17 of 17)  
<<< Previous 7 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: image map
Date: 15 Jun 2002 16:24:24
Message: <3d0ba278@news.povray.org>
TinCanMan <Tin### [at] hotmailcom> wrote:
> In order to get the label to wrap
> partially around the bottle (unless you want it fully wrapped) you have to
> compensate in the image_map image itself.

  This is quite an ugly method because you either need to make an extra-large
image, which will consume unneeded memory, or you'll have to use a lower
resolution. Not nice.
  Instead of this, make a pigment with your image_map (using the 'once'
option), scale it down to the desired size and then apply the cylindrical
warp to it.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: ulli
Subject: Re: image map
Date: 15 Jun 2002 17:26:39
Message: <3D0BB11A.70100@gmx.de>
i really dont know what im doing wrong, but the labe always get 
strectched on the left/rigth edge (http://www.winter-privat.de/bottle2.jpg)
this one is with pigment map for the lower label


Post a reply to this message

From: bob h
Subject: Re: image map (cylindrical warping?)
Date: 15 Jun 2002 21:42:57
Message: <3d0bed21@news.povray.org>
"ulli" <ull### [at] gmxde> wrote in message news:3D0### [at] gmxde...
> i really dont know what im doing wrong, but the labe always get
> strectched on the left/rigth edge
(http://www.winter-privat.de/bottle2.jpg)
> this one is with pigment map for the lower label

Coming back late on this. I am not much on using 'warp', expecially the new
types, so all I could do is:


camera {
  location  <1,3,-5>
  right     x*image_width/image_height
  look_at   <0,2,0>
}

light_source {
  <-30, 30, -30>,
  color rgb 1
}

plane {
  y, -0.001
  texture {
    pigment { checker color rgb <1,1,0> color rgb <0,1,0> }
  }
}

cylinder {
  0, 2*y, 1
  texture {
    pigment {
      image_map {
        png "testlabel.png" // I used 300 by 300 res. for this
        interpolate 2
        once
        filter 255, 2/3 // set a pallete index to filtered value
      }
      warp {
        cylindrical
        orientation z
        dist_exp 0
        }
      rotate -90*y
      scale <1,2,1>
    }
  }
 scale <1,2,1>
}

This wraps around like map_type 2 in image_map but I couldn't get the effect
Warp mentioned. I scaled and changed dist_exp only to get a distorted label,
apparently similar to your outcome, ulli.
Either I misunderstood or I didn't hit upon the correct transformation.

bob h


Post a reply to this message

From: bob h
Subject: Re: image map
Date: 15 Jun 2002 22:27:24
Message: <3d0bf78c@news.povray.org>
You know the idea then, I'm sure.

Say a 3.14*100 wide image (in pixels) is the pi, or cylinder circumference,
and the height is always 1 POV unit to start with; but you'd then want that
number to be a 3.14:0.5 (yeah, 0.5, not 1.0) ratio of width to height.
Voila! 314 wide by 50 height, or any rescale of that ratio, will fit
proportionally correct on a POV unit cylinder primitive because it is 2
units diameter, 1 unit tall, and pi*2 units in circumference.

I sort of misspoke before by not pointing out map_type 2 has such a "unit"
system to it. It's not 1 in diameter. I really shouldn't have ever said it
the way I did so haphazardly, pi * height is just plain wrong. It's actually
pi * (height/2). Sorry, I can confuse better than I can help  ;-)
Were the units done differently it would be simpler to think of it as 1 for
diameter, 1 for height, making it pi for circumference. So try to keep that
in mind, that it is 2 across instead yet only 1 unit tall.

Okay, I'm probably digging myself into a hole so I'll shut up now.

bob h


Post a reply to this message

From: Simon Adameit
Subject: Re: image map (cylindrical warping?)
Date: 16 Jun 2002 00:26:05
Message: <3d0c135d@news.povray.org>
>
> This wraps around like map_type 2 in image_map but I couldn't get the
effect
> Warp mentioned. I scaled and changed dist_exp only to get a distorted
label,
> apparently similar to your outcome, ulli.
> Either I misunderstood or I didn't hit upon the correct transformation.
>
You need to scale before you apply the warp.


Post a reply to this message

From: ulli
Subject: Re: image map
Date: 16 Jun 2002 10:26:13
Message: <3D0CA011.20907@gmx.de>
bob h wrote:

> Voila! 314 wide by 50 height, or any rescale of that ratio, will fit
> 

ive tried it, but the label only doesnt get distorted if i use the 
initial translate and scale settings. but then its size isnt correct.
these are the settings:
             translate <-0.5,0.1,0>
           scale <4/10,6.2/10,4/10>


http://www.winter-privat.de/bottle3.jpg
and that is the bottle


Post a reply to this message

From: TinCanMan
Subject: Re: image map
Date: 16 Jun 2002 10:49:57
Message: <3d0ca595$1@news.povray.org>
> ive tried it, but the label only doesnt get distorted if i use the
> initial translate and scale settings. but then its size isnt correct.
> these are the settings:
>              translate <-0.5,0.1,0>
>            scale <4/10,6.2/10,4/10>

Hmmm, remember this mantra 'scale, then translate, scale, then translate'

First of all, cylindrical image_maps are defined around the 'y' axis and
extends from y=0 to y=1 so your object needs to be centered on the y axis
before applying the image_map if you don't want weird results.

Likewise, scaling (also rotation) occurs around the origin. You should
always create your object at the origin and apply any scaling before
translating.

-tgq


Post a reply to this message

From: bob h
Subject: Re: image map (cylindrical warping)
Date: 16 Jun 2002 12:07:20
Message: <3d0cb7b8@news.povray.org>
"Simon Adameit" <gom### [at] gmxde> wrote in message
news:3d0c135d@news.povray.org...
>
> You need to scale before you apply the warp.

Thanks Simon, that sure seems to be the answer all right.


camera {
  location  <1,2,-4>
  right     x*image_width/image_height
  look_at   <0,0,0>
  angle 50
}

light_source {
        <-30,30,-30>,
        1
}

plane {
  y, -0.001
  texture {
    pigment { checker color rgb <1,1,0> color rgb <0,1,0> }
  }
}

cylinder {
  0, y, 1
  texture {
    pigment {
      image_map {
        png "testlabel2.png" // a 314 wide by 50 high image
        interpolate 2
        once
        filter 215, 2/3
      }
        scale <.25,.25,1>
        translate y/2
      warp {
        cylindrical
        orientation z
        dist_exp 0
        }
      rotate 120*y
    }
  }
}

Something strange happens with the cylinder here. Looks like coincident
surfaces to me except it also reverses the checker pattern of the floor
plane, as seen through that otherwise invisible cylinder. Only the label has
texture, no 'ior' in that.

bob h


Post a reply to this message

From: Warp
Subject: Re: image map (cylindrical warping)
Date: 16 Jun 2002 15:52:00
Message: <3d0cec60@news.povray.org>
bob h <omn### [at] charternet> wrote:
> Something strange happens with the cylinder here. Looks like coincident
> surfaces to me except it also reverses the checker pattern of the floor
> plane, as seen through that otherwise invisible cylinder. Only the label has
> texture, no 'ior' in that.

  It doesn't seem to be related to the texture (if you apply any trasnparent
texture to the cylinder, the same artifact happens).
  I don't know why it happens, but if you make the plane y, -0.01 then
it fixes it.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: bob h
Subject: Re: this plane under cylinder oddity
Date: 16 Jun 2002 22:02:29
Message: <3d0d4335$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3d0cec60@news.povray.org...
> bob h <omn### [at] charternet> wrote:
> > Something strange happens with the cylinder here. Looks like coincident
> > surfaces to me except it also reverses the checker pattern of the floor
> > plane, as seen through that otherwise invisible cylinder. Only the label
has
> > texture, no 'ior' in that.
>
>   It doesn't seem to be related to the texture (if you apply any
trasnparent
> texture to the cylinder, the same artifact happens).
>   I don't know why it happens, but if you make the plane y, -0.01 then
> it fixes it.

Interesting. I checked that as you said and found now that if it's
at -0.00101 or -0.00099 there's no artifacting. Strange, huh...? I can't
figure any reasoning for this.

bob h


Post a reply to this message

<<< Previous 7 Messages Goto Initial 10 Messages

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