POV-Ray : Newsgroups : povray.binaries.scene-files : Mosaic Source Server Time
1 Sep 2024 20:16:23 EDT (-0400)
  Mosaic Source (Message 1 to 1 of 1)  
From: Aaron Gillies
Subject: Mosaic Source
Date: 16 Dec 2003 19:42:41
Message: <3fdfa681$1@news.povray.org>
As requested ...

Requires an external file named "mozaik.jpg".  This file contains
the image to be mosaic-ized.

Aaron




#include "rand.inc"
#include "functions.inc"

camera {
  location <0, 0, -65>
  look_at <0, 0, 0>
  }

light_source {
  <-20000, 40000, -30000>
  color rgb 2
  }

light_source {
  <00000, 00000, -30000>
  color rgb .5
  }

plane {
  z, 0
  rotate <180, 0, 0>
  texture {
    pigment {
      color rgb <.75, .5, .25>
      }
    }
  }

#local I =

  pigment {
    image_map {
      jpeg "mozaik.jpg"
      }
    translate <0, -.5, 0>
    scale <100, 70, 1> * 2
    }

#local Count = 10;

#local SplineX = spline {

  natural_spline

  #while (Count > 0)

    Count * 10, <0, SRand(RdmA), 0>

    #local Count = Count - 1;

  #end

  }

#local Count = 10;

#local SplineY = spline {

  natural_spline

  #while (Count > 0)

    Count * 10, <SRand(RdmA) * 1, 0, 0>

    #local Count = Count - 1;

  #end

  }

#local SizeX = 100;
#local NumX = 100;
#local CountX = NumX;

#while (CountX > 0)

  #local SizeY = 100;
  #local NumY = 100;
  #local CountY = NumX;

  #while (CountY > 0)

    #local PosX = CountX + SplineY(CountY).x * 2 - (SizeX / 2);
    #local PosY = CountY + SplineX(CountX).y * 2 - (SizeY / 2);

    #local P = eval_pigment(I, <PosX, PosY, 0>);

    superellipsoid {
      <.5, .5>
      rotate <0, 0, SRand(RdmB) * 15>
      scale RRand(.35, .75, RdmB)
      translate <PosX, PosY, 0>
      texture {
        pigment {
          marble
          turbulence .25
          scale 1
          color_map {
            [0.0 P]
            [1.0 P - .125]
            }
          rotate 45
          }
        finish {
          specular 1
          roughness .005
          }
        normal {
          bozo scale .25
          }
        }
      }

    #local CountY = CountY - 1;

  #end

  #local CountX = CountX - 1;

#end


Post a reply to this message

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