POV-Ray : Newsgroups : povray.binaries.images : Very WIP : Re: Very WIP Server Time
17 Aug 2024 04:17:05 EDT (-0400)
  Re: Very WIP  
From: Bill DeWitt
Date: 13 Nov 2001 11:51:03
Message: <3bf14f77$1@news.povray.org>
My indenting got eaten by the news reader... here is something more
readable... I hope...

#declare  SPHERE = function {x^2 + y^2 + z^2 -1}

//... then one for your imagemap

#declare  IMAGEMAP  =
function {
                 pigment {
                         image_pattern {
                               tga "ImageMapHF16.tga"
                               map_type 1
                               interpolate 2
                              }
                scale < 0.0, 0.0, -1.0 >
                                        }
                               }

//    ... then you add them together....

#declare SHIP=function{
                              SPHERE(x,y,z)
                           - IMAGEMAP(x,y,z).grey *.75 }

//     ... then you make it an isosurface...

isosurface {
  function { SHIP(x,y,z) }
        evaluate 1, 1000, 0.99
        max_gradient 200
        contained_by{sphere{0,1.5}}
        pigment { rgb 1 }
        scale < 1.0, 0.25, 0.75 >
}

"Bill DeWitt" <bde### [at] cflrrcom> wrote in message
news:3bf14dfa$1@news.povray.org...
>
> "Captain Tylor" <fis### [at] hrupennedu> wrote in message
> news:3bf138ae$1@news.povray.org...
> > I didn't know you could use image maps on isosurfaces.  Is there a
source
> > code example anywhere of using an image map on an isosurface that I
could
> > see?
>
> First you make a function for your sphere...
>
>
> #declare  SPHERE = function {x^2 + y^2 + z^2 -1}
>
> //... then one for your imagemap
>
> #declare  IMAGEMAP  = function {
>                                 pigment {
>                                          image_pattern {
>                                                         tga
> "ImageMapHF16.tga"
>                                                         map_type 1  //
> spherical
>                                                         interpolate 2
>                                                        }
>                                          scale < 1.0, 1.0, -1.0 > // flips
> (optional)
>                                         }
>                                }
>
> //    ... then you add them to gether....
>
> #declare SHIP=function{SPHERE(x,y,z) - IMAGEMAP(x,y,z).grey *.75 }
>
> //     ... then you make it an isosurface...
>
> isosurface {
>   function { SHIP(x,y,z) }
>         max_gradient 200
>         contained_by{sphere{0,1.5}}
>         pigment { rgb 1 }
>         scale < 1.0, 0.25, 0.75 >
> }
>
>
>


Post a reply to this message

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