POV-Ray : Newsgroups : povray.binaries.images : Tilemap patch for Megapov 1.2 Server Time
6 Aug 2024 19:24:49 EDT (-0400)
  Tilemap patch for Megapov 1.2 (Message 1 to 4 of 4)  
From: Chris Jeppesen
Subject: Tilemap patch for Megapov 1.2
Date: 10 Sep 2006 21:48:19
Message: <4504c063@news.povray.org>
A sample image for a patch I made to Megapov 1.2, which I hope to have
incorporated into the next version. Read about it in
povray.unofficial.patches .

sphere {
  0,5
  pigment {
    image_map {
      tile_map {
        6,6
        [0,0 png "1test.png"]
        [0,2 png "1test.png"]
        [0,4 png "1test.png"]
        [1,1 png "2test.png"]
        [1,3 png "2test.png"]
        [2,0 png "3test.png"]
        [2,2 png "3test.png"]
        [2,4 png "3test.png"]
        [3,1 png "4test.png"]
        [3,3 png "4test.png"]
        [4,0 png "5test.png"]
        [4,2 png "5test.png"]
        [4,4 png "5test.png"]
      }
      map_type 0
    }
  }
}

light_source {
  <20,20,-20>*1000
  color 1.5
}

camera {
  location <0,2,-5>*2
  look_at <0,0,0>
}


Post a reply to this message


Attachments:
Download 'tilemap.png' (522 KB)

Preview of image 'tilemap.png'
tilemap.png


 

From: Rune
Subject: Re: Tilemap patch for Megapov 1.2
Date: 12 Sep 2006 08:31:13
Message: <4506a891$1@news.povray.org>
Chris Jeppesen wrote:
> A sample image for a patch I made to Megapov 1.2, which I hope to have
> incorporated into the next version. Read about it in
> povray.unofficial.patches .

Well, that's nice, but couldn't the same thing have been made with a macro 
using nested gradient patterns? The syntax wouldn't be as neat, but it could 
still be made rather easy (if a bit clumsy):

#declare tile_map = array[13][2] {
{array[2]{0,0},array[2]{"png","1test.png"}},
{array[2]{0,2},array[2]{"png","1test.png"}},
{array[2]{0,4},array[2]{"png","1test.png"}},
{array[2]{1,1},array[2]{"png","2test.png"}},
...
}

Or a different approach:

#declare tile_map = array[13][2] {
{"0,0","1test.png"},
{"0,2","1test.png"},
{"0,4","1test.png"},
{"1,1","2test.png"},
...
}

And the macro could then be invoked with something like this:

pigment {MakeTileMap(6,6,tile_map)}

Rune
-- 
http://runevision.com


Post a reply to this message

From: Chris Jeppesen
Subject: Re: Tilemap patch for Megapov 1.2
Date: 12 Sep 2006 11:13:23
Message: <4506ce93@news.povray.org>
Rune wrote:
> Chris Jeppesen wrote:
>> A sample image for a patch I made to Megapov 1.2, which I hope to have
>> incorporated into the next version. Read about it in
>> povray.unofficial.patches .
> 
> Well, that's nice, but couldn't the same thing have been made with a macro 
> using nested gradient patterns? The syntax wouldn't be as neat, but it could 
> still be made rather easy (if a bit clumsy):
> 
...
> 
> And the macro could then be invoked with something like this:
> 
> pigment {MakeTileMap(6,6,tile_map)}
> 
> Rune

I don't quite understand. What would MakeTileMap do? Does it create
zillions of layered pigments where each tile gets a layer? I tried that
before I wrote the patch, there is only limited layering in a texture,
and at some points I needed to use more tiles than was permitted.

I have never heard of a nested gradient pattern.


Post a reply to this message

From: Rune
Subject: Re: Tilemap patch for Megapov 1.2
Date: 13 Sep 2006 09:55:49
Message: <45080de5@news.povray.org>
Chris Jeppesen wrote:
> I don't quite understand. What would MakeTileMap do? Does it create
> zillions of layered pigments where each tile gets a layer?

No, it doesn't use layers at all.

> I have never heard of a nested gradient pattern.

Here's a simple example of 2x2 tiles in a nested gradient:

plane {
   -z, 0
   pigment {
      #declare Img1 = pigment {image_map {png "1test.png"} scale 0.5}
      #declare Img2 = pigment {image_map {png "2test.png"} scale 0.5}
      #declare Img3 = pigment {image_map {png "3test.png"} scale 0.5}
      #declare Img4 = pigment {image_map {png "4test.png"} scale 0.5}
      #declare RowA = pigment {gradient x pigment_map {[0.0, Img1][0.5, 
Img1][0.5, Img2][1.0, Img2]}}
      #declare RowB = pigment {gradient x pigment_map {[0.0, Img3][0.5, 
Img3][0.5, Img4][1.0, Img4]}}
      gradient y
      pigment_map {[0.0, RowA][0.5, RowA][0.5, RowB][1.0, RowB]}
   }
   finish {ambient 1 diffuse 0}
   translate 2*z
}

Rune
-- 
http://runevision.com


Post a reply to this message

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