POV-Ray : Newsgroups : povray.general : image map on cone - help me understand : Re: image map on cone - help me understand Server Time
1 Aug 2024 12:21:05 EDT (-0400)
  Re: image map on cone - help me understand  
From: Rick DeNatale
Date: 12 Oct 2005 10:13:25
Message: <434d1a05$1@news.povray.org>
Chris B wrote:

> To get text wrapping right the way round the cone you could look at using a 
> text object as a pigment. You could create a texture for each letter and 
> orient each letter so that it's parallel to the surface of the cone at the 
> position you want. 

Actually I don't think that thats what I want, the letters actually need
to be narrower at the top than at the bottom.

I went back and looked at the png I was using and it wasn't quite right.
 On the original spacecraft, the words UNITED and STATES were stacked
over each other and justified, my png had UNITED longer than STATES. I
went back and manually kerned STATES and now it looks better, with the
cylindrical wrap.

I'm still trying to understand just how cylindrical mapping works.  The
documentation on map_types leaves some "exercises to the reader". Here's
how I think it works. To simplify things, I'm going to wrap the map
around a cone centered on the y-axis say cone { <0,bot,0>, r1,
<0,top,0>, r2 }

Please let me know if I've got any of this wrong:

1. The bit map is wrapped around a 1 unit high cylinder around the
y-axis, with the bottom at y=0 and the top at y=1.  The bottom left edge
of the map is on the x-axis, and the map wraps in a -y rotation, with
the right side meeting the left side to form a complete cylinder.

2. To make the cylinder cover the height of the cone, I need to:
      scale y*(top-bot)
3. And to align it with the cone I need to
      translate y*bot

So I've got:

     object {
        cone { <0,bot,0>, r1, <0,top,0>, r2 }
        pigment {
           image_map {
                png "myPng.png"
                map_type 2  // spherical map
                once   // prevents the map from repeating VERTICALLY
                scale y*(top-bot)
                translate y*bot
           }
        }
     }

4. Now to decide the color of a point on the object while I'll call
<Xp,Yp,Zp>. The color will be the color at the closest point where the
line between <Xp,Yp,Zp> and <0,yc,0>. This is why the cylinder can be
"of any diameter".

Another way of looking at this is that the "x" coordinate of a pixel in
the map represents an negative angle of rotation about the y axis, with
the angle in degrees being -360*(mapWidth/x). So if I draw my bitmap(s)
with this coordinate transformation in mind I should be okay. The main
reason I'd need multiple maps would be if I was bothered by the
"Greenland" effect as I got to top or bottom of the bitmap which was at
the narrow end of the cone.

The main difference between a planar, cylindrical, and spherical map
type, besides the "shape transformation of the map in step 1, is that in
a planar map the projection lines in step 4, will be between <Xp,Yp,Zp>
and <Xp,Yp,0>; and for a spherical map between <Xp,Yp,Zp> and <0,0,0>.

At this stage of my learning I'm not going to think much about either
the toroidal mapping nor what happens in the spherical mapping due to
the singularity at the poles of the cylinder.


Post a reply to this message

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