POV-Ray : Newsgroups : povray.general : Need for new pattern - cubediv? : Re: Need for new pattern - cubediv? Server Time
31 Jul 2024 20:12:37 EDT (-0400)
  Re: Need for new pattern - cubediv?  
From: chaps
Date: 30 Sep 2006 15:45:01
Message: <web.451ec7a549dcb598eb7c3d8d0@news.povray.org>
I have tried the 2 solutions and here are the results:

                    Warp          |  Pascal
                   method         |  method
                                  |
complexity       Warp win:        |  I got some
                 cut & paste      |  syntax error
                                  |
result           Warp win:        |  blured picture
                 good definition  |
                                  |
render time      41s on my PC     |  Pascal win
                                  |  14s on my PC
                                  |
evolution        Can be use for   |  I dont see how
                 texture mapping? |  to extend to
                 I guess yes.     |  texture mapping

So I think your method is much better....
...... and understandable after some rest + 1 cofee.

Pascal

the code I used:

##############  create spherical image
global_settings {
  ambient_light color rgb <1,1,1>
}
camera {
  spherical
  location <0,0,0>
  look_at  <0,0,-1>
  angle 360             // horizontal degrees
        180             // vertical degrees
}
#declare Image =
  pigment
  { image_map { jpeg "mosquee1.jpg" once}
    translate -.5
    scale 2
  };
#declare face =
         plane {
                -z,
                1.0
                hollow on
                no_shadow
                pigment { Image }
                finish {
                ambient 1
        }
}
object {face rotate x*-90}
object {face rotate x*90}
object {face rotate y*90}
object {face rotate y*-90}
object {face rotate y*0}
object {face rotate y*180}

######################"  Test methods: looks like Warp code :))

camera { location -z*6 look_at 0 angle 35 }
light_source { <15, 20, -50>, 2 }
#declare Pyramid = function { abs(x) < y & abs(z) < y };
#declare CubePattern =
  function
  { Pyramid(x, -z, y)*1/6+
    Pyramid(y, x, z)*2/6+
    Pyramid(x, z, y)*3/6+
    Pyramid(y, -x, z)*4/6+
    Pyramid(x, -y, z)*5/6
  };
#declare Image =
  pigment
  { image_map { jpeg "mosquee1.jpg" }
    translate -.5
    scale 2
  };
#declare ThePigment =
  pigment
  { function { CubePattern(x, y, z) }
    pigment_map
    { [0/6 Image rotate x*90]
      [1/6 Image]
      [2/6 Image rotate -y*90]
      [3/6 Image rotate -y*180]
      [4/6 Image rotate y*90]
      [5/6 Image rotate -x*90]
    }
  };
#declare ThePigment2 =
  pigment
  {
     image_map {
        tga "SpericalMap.tga"
        map_type 1        // 1=spherical
        interpolate 2     // 2=bilinear,
        once              // for no repetitive tiling
     }
  };
superellipsoid
{ <.2, .2>
  pigment { ThePigment }
  rotate y*30 rotate x*-30
}


Post a reply to this message

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