POV-Ray : Newsgroups : povray.binaries.images : Just in time for Christmas, Hopefully : Re: Just in time for Christmas, Hopefully Server Time
2 Aug 2024 08:14:59 EDT (-0400)
  Re: Just in time for Christmas, Hopefully  
From: Alain
Date: 18 Dec 2007 11:01:50
Message: <4767eeee$1@news.povray.org>
Leef_me nous apporta ses lumieres en ce 2007/12/18 02:42:
> "Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
>> Thanks, Tim, that works a treat.
>>
>> A.D.B.
>>
>> "Tim Attwood" <tim### [at] comcastnet> wrote:
>>> The problem is too many control points in a small space.
>>> This is similar to other floating point accuracy issues, because
>>> of floating point errors some of the points in your lathe are
>>> doubling back, or coincident. A work-around is to scale up your
>>> lathe's control points, then scale down the lathe to the desired size.
>>> ....
> 
> Hey Anthony,
> 
> Congrat on the nice bulbs.
> 
> 
> 
> 
> 
> I tried to use an image for the bulb material, but I cannot scale it.
> 
> Here is my code, can you point out what I am doing wrong?
> 
> Thank you.
> 
> Leef_me
> 
> 
> //start
> 
> #include "xmas_bulb.inc"
> 
> 
> #version 3.6;
> 
> #include "colors.inc"
> 
> global_settings {
>   assumed_gamma 1.0
> }
> 
> // ----------------------------------------
> 
> camera {
>   location  <0.0, 0.5, -8.0>
>   direction 1.5*z
>   right     x*image_width/image_height
>   look_at   <0.0, 0.0,  0.0>
> }
> 
> sky_sphere {
>   pigment {
>     gradient y
>     color_map {
>       [0.0 rgb <0.6,0.7,1.0>]
>       [0.7 rgb <0.0,0.1,0.8>]
>     }
>   }
> }
> 
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
> 
> 
> 
> #declare bulb = material {
>              texture {
>         pigment { image_map { jpeg "Dime_front.jpg" map_type 1
>         } scale 0.01
>    }
>   }
> }
> #declare capq2 = material {
>              texture {
>         pigment { rgb <1,1,0>
>         }
>    }
> }
> 
> #declare place = transform {
>         translate <0,0,0>
>         rotate y*360*clock
> }
> 
> ChristmasBulb(bulb, capq2, 0, place)
> 
> 
> //end
> 
> 
> 
When you scale a spherical pattern, all points move acording to the origin.
What you need is to use a warp{spherical} after the scaling.
Your image_map become:
#declare bulb = material {
              texture {
         pigment { image_map { jpeg "Dime_front.jpg" map_type 0
//Use a planar maping
         	scale 0.01
warp{spherical} // Wrap it around the sphere
		}
    }
   }
}
Now, your image get repeated 100 times around the circumference and 50 times 
from one pole to the other.
-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you can recite your high school 
Trig book from memory.


Post a reply to this message

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