|
|
Dr. Doogie nous apporta ses lumieres ainsi en ce 2004/04/28 14:11... :
>Hi everyone,
>
>I need to map an image on a deformed cylinder (<0,0,0> , <0,1,0>, 25 scale
><0.5, 1, 1.5> )
>
>When i map an image on it, it's not correct. There are mapping imperfections
>on the narrowest edges (on the 2 sides where the radius of curvature is at
>its lowest). The part of the image mapped on these sides is more stretched
>(horizontally) than the rest. (Actually i map an image that features some
>number like 123456790 and the 2 that are on the edges are lot more wider
>than the others).
>
>Is there a better way to map an image on a deformed cylinder ?
>
>Here an excerpt of my code :
>
>union {
> cylinder { <0, 0, 0>, <0, 1, 0>, 25
> scale <0.5, 1, 1.5>
> }
>
> texture {
> pigment {
> image_map {
> png "C:\Image.388\mapCylinder.png"
> map_type 2
> interpolate 2
>
> filter all 0.1
> }
> }
> finish { reflection {0.0} ambient 0.0 diffuse 0.3 }
> }
> scale<1,100,1>
>}
>
>Thank you for your help
>Dr Doogie
>
>
>
You use cylindrical maping, so, the image is applied acording to the
*angle* to a solid from whitch the deformed cylinder is carved out. At
the narrow parts, the image get stretched. Thats the why of your problem.
The cure to it:
Solution one: distord your image to compensate. Limits: ONLY works in
that particular case, is you rotate the image around the object, the
distortion will get worst.
Solution two: Use UV-Maping. That way, the image will follow any
deformation you may inflict to your cylinder.
Solution tree: Apply the texture before you scale the cylinder. You may
still see some distortions.
Alain
Post a reply to this message
|
|