POV-Ray : Newsgroups : povray.binaries.images : T_Stones ref charts : T_Stones ref charts Server Time
8 Aug 2024 06:20:44 EDT (-0400)
  T_Stones ref charts  
From: PM 2Ring
Date: 11 Sep 2005 09:25:01
Message: <web.43242e97c626dadf77d3bc6c0@news.povray.org>
Here is a scene file that produces a couple of images containing all the
standard T_Stone textures from stones.inc on numbered superellipsoids. Run
it as a single image to get T_Stone1 to T_Stone44 in one file, or run it a
two or three frame animation to get T_Stone1 to T_Stone25 in frame 1,
T_Stone25 to T_Stone44 in frame 2. and T_Stone1 to T_Stone44 in frame 3.

I hope this is useful to someone. :)

//-------------------------------------------------------------

// Persistence of Vision Ray Tracer Scene Description File
// File: Boxes.pov
// Vers: 3.5
// Desc: Show T_Stone textures on numbered superellipsoids in ZX plane
// Date: 24 Apr 2004
// Auth: PM 2Ring
//
//  -F +A0.5 +AM2 +R2
//  -D +A0.1 +AM2 +R2 +KFF3
//

global_settings {
  assumed_gamma  1.0
}

#include "colors.inc"
// T_Stone1 - T_Stone44
#include "stones.inc"

#declare MK=44;   //Number of complete stone textures defined in stones.inc

//Build a stone names array. We do this in an include file,
//since we can't manipulate identifiers directly
#declare FileName = "StonesArray0.inc";

#if(!file_exists(FileName))
  #debug concat("\n\nBuilding include file, ", FileName, "...\n")

  #fopen MyFile FileName write
  #write (MyFile, "#declare StonesArray = array[", str(MK,0,0), "]{\n  ")

  #declare Sep = array[2]{",\n  ", ", "}  //output separator sequences

  #declare K=1;
  #while (K<=MK)
    #write (MyFile, concat("T_Stone", str(K,0,0), Sep[!!mod(K,5)]))
    #declare K=K+1;
  #end

  #write (MyFile, "\n}\n")
  #fclose MyFile
#else
  #debug concat("\n\nInclude file, ", FileName, " already exists.\n")
#end

//Load our stone names array
#include FileName

//Rounded box, with cutout in front face
#declare Scale = <3, 2, 1>;
#declare SScale = vlength(Scale)/sqrt(3);

#declare RBox =
difference{
  superellipsoid {
    <0.4, 0.4>
    scale Scale
  }

  //Cutout
  superellipsoid {
    <0.1, 0.1>
    scale Scale - .5
    translate -1.25*z
  }
}

#macro TextBox(Str)
union{
  object{RBox}

  text {
    ttf "timrom.ttf" Str .975, 0
    scale 3
    translate <-1.25, -1.125, -.975>
  }
}
#end

#macro BoxGrid(MJ, MI, K0)
union{
  #declare K=K0;
  #declare I=0;
  #while (I<MI)
    #declare J=0;
    #while (J<MJ)
      object{TextBox(str(K+1,2,0))
        texture{StonesArray[K] scale SScale}
        translate <2*J-MJ+1, 2*I-MI+1, 0> * (Scale * 1.15 * <1, -1.2, 1>)
      }
      #declare J=J+1;
      #declare K=mod(K+1, MK);
    #end
    #declare I=I+1;
  #end
}
#end

//-------------------------------------------------------------

//Select stones based on frame number
#switch(frame_number)
  #case(1)
    #declare GX = 5;
    #declare GY = 5;
    #declare K0 = 0;
  #break
  #case(2)
    #declare GX = 5;
    #declare GY = 4;
    #declare K0 = 24;
  #break
  #else
    #declare GX = 7;
    #declare GY = 6;
    #declare K0 = 0;
  #break
#end

BoxGrid(GX, GY, K0)

camera {
  //orthographic
  location  -10 * max(GX, GY) * z
  look_at   0
  right     x*image_width/image_height up y
  direction z
  angle 40
}

light_source {<-5, 15, -20>*20 rgb 1}

background{rgb .5}

//-------------------------------------------------------------


Post a reply to this message


Attachments:
Download 'stoneblocksa1s.jpg' (78 KB)

Preview of image 'stoneblocksa1s.jpg'
stoneblocksa1s.jpg


 

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