POV-Ray : Newsgroups : povray.general : Bricked vault Server Time
31 Jul 2024 18:21:48 EDT (-0400)
  Bricked vault (Message 1 to 6 of 6)  
From: Zoly
Subject: Bricked vault
Date: 10 Nov 2006 15:30:00
Message: <web.4554e04ace7089d1f6a4e110@news.povray.org>
Hi,

I am creating a vaulted aisle (like in a gothic cathedral). The shape of the
vault is not a sphere or a cylinder, it is a complex mathematic surface
function. I need to make it look like made of bricks using the 'brick'
pigment but I can not find the way to make the bricks to appear correctly.

I build the surface with a mesh made of triangles calculated on the fly
using the 3D function (much faster than the corresponding isosurface).

To apply the bricks, I am using uv_mapping and uv_vectors but always the
bricks appear well on the upper side (almost horizontal) but highly
distorted in the almost or completely vertical surfaces in the lower part.
If I try to calculate the uv_vectors to take the appropriate portion of the
brick pigment, then the pigments on each triangle doesn't match with their
neighbours.

I feel that I'm walking in the wrong direction. Any lights?

Thanks,
Zoly


Post a reply to this message

From: Kyle
Subject: Re: Bricked vault
Date: 11 Nov 2006 01:16:06
Message: <ujqal2p9hvo7o2c5s9cf1bhcsgldj5b4fj@4ax.com>
Maybe some code and/or a sample image might help...


Kyle


Post a reply to this message

From: Tek
Subject: Re: Bricked vault
Date: 11 Nov 2006 01:37:46
Message: <45556fba$1@news.povray.org>
"Zoly" <nomail@nomail> wrote in message 
news:web.4554e04ace7089d1f6a4e110@news.povray.org...
> To apply the bricks, I am using uv_mapping and uv_vectors but always the
> bricks appear well on the upper side (almost horizontal) but highly
> distorted in the almost or completely vertical surfaces in the lower part.
> If I try to calculate the uv_vectors to take the appropriate portion of 
> the
> brick pigment, then the pigments on each triangle doesn't match with their
> neighbours.

If your uv's don't match up between faces then you're going to see 
discontinuities, but for what you want it might be easier to switch off 
uv_mapping and just line the pattern up as best you can using scale & 
rotate.

-- 
Tek
http://evilsuperbrain.com


Post a reply to this message

From: Zoly
Subject: Re: Bricked vault
Date: 11 Nov 2006 03:45:01
Message: <web.45558b98718327621f6a4e110@news.povray.org>
Kyle <hob### [at] gatenet> wrote:
> Maybe some code and/or a sample image might help...
>
>
> Kyle

I'm posting a small scene that reproduces the problem. It is not very
easibly readable but you can cut and paste and have a look at the image.

Thanks,
Zoly


//--- VAULT CONSTRUCTION
#macro Vault(P01,r1,a1,n1,P02,r2,a2,n2,h)

   #local dd=0.00001;
   #local dl=0.1;
   #local h1=r1*sqrt(2*n1-1);
   #local h2=r2*sqrt(2*n2-1);
   #local x01=P01.x;
   #local x02=P02.x;
   #local z01=P01.z;
   #local z02=P02.z;

   #local fr1=function(y) {

(y>h-h1)*(-r1*(n1-1)+sqrt(pow(r1*n1,2)-(y>h-h1)*pow(y-(h-h1),2)))+(y<=h-h1)*r1
   }

   #local fr2=function(y) {
      (y>=h-h2)*(-r2*(n2-1)+sqrt(pow(r2*n2,2)-pow(y-(h-h2),2)))+(y<=h-h2)*r2
   }

   #local x1=function(y) {x01+fr1(y)*cos(radians(a1))}
   #local x2=function(y) {x02+fr2(y)*cos(radians(a2))}
   #local z1=function(y) {z01-fr1(y)*sin(radians(a1))}
   #local z2=function(y) {z02-fr2(y)*sin(radians(a2))}

   mesh {
      #local i=h;
      #while (i>0)
         #local a_i=i;
         #local i=i-dl/sqrt(1+pow((fr1(i)-fr1(i-dd))/dd,2));
         triangle {
            <x1(a_i),a_i,z1(a_i)> <x2(a_i),a_i,z2(a_i)> <x1(i),i,z1(i)>
            uv_vectors <x1(a_i),z1(a_i)> <x2(a_i),z2(a_i)> <x1(i),z1(a_i)>
         }
         triangle {
            <x2(a_i),a_i,z2(a_i)> <x1(i),i,z1(i)> <x2(i),i,z2(i)>
            uv_vectors <x2(a_i),z2(a_i)> <x1(i),z1(i)> <x2(i),z2(i)>
         }
      #end
      texture {
         uv_mapping
         pigment {
            brick rgb 0.15 rgb 0.2
            scale 0.08
            rotate 90*z
         }
      }
   }
#end

//--- MAIN OBJECT
object {Vault(<0,5,-3.59>,3.555,0,1.2,<0,5,0>,5,40,1,5)}
object {Vault(<0,5,-3.59>,3.555,0,1.2,<0,5,0>,5,40,1,5) scale <-1,1,1>}


//--- SECONDARY STAFF
light_source {<0,0,0> 2}
light_source {<50,50,-50> 5}
camera {location <4,2,-10> look_at <0,2,1> rotate <0,-10,0>}
plane {y, 0 pigment {rgb <0.08,0.02,0>}}
sky_sphere {pigment {rgb <0.04,0.04,0.2>}}


Post a reply to this message

From: Kyle
Subject: Re: Bricked vault
Date: 11 Nov 2006 23:51:03
Message: <nv9dl21dumsfa4dle33l7avrc6jfu67iap@4ax.com>
Zoly,

Here's my suggestion:

>>> snip >>>

   #local U = 0;
   
   mesh {
      #local i=h;
      #while (i>0)
         #local a_i=i;
         #local i=i-dl/sqrt(1+pow((fr1(i)-fr1(i-dd))/dd,2));
         #local Uinc = abs(vlength(<x2(a_i),a_i,z2(a_i)>-<x2(i),i,z2(i)>));
         triangle {
            <x1(a_i),a_i,z1(a_i)> <x2(a_i),a_i,z2(a_i)> <x1(i),i,z1(i)>
            uv_vectors <U,z1(a_i)> <U,z2(a_i)> <U+Uinc,z1(i)>
         }
         #debug concat("T1: ",vstr(3,<x1(a_i),a_i,z1(a_i)>,",",0,5))
         #debug concat(" - ",vstr(3,<x2(a_i),a_i,z2(a_i)>,",",0,5))
         #debug concat(" - ",vstr(3,<x1(i),i,z1(i)>,",",0,5),"\r")
         triangle {
            <x2(a_i),a_i,z2(a_i)> <x1(i),i,z1(i)> <x2(i),i,z2(i)>
            uv_vectors <U,z2(a_i)> <U+Uinc,z1(i)> <U+Uinc,z2(i)>
         }
         #debug concat("T2: ",vstr(3,<x2(a_i),a_i,z2(a_i)>,",",0,5))
         #debug concat(" - ",vstr(3,<x1(i),i,z1(i)>,",",0,5))
         #debug concat(" - ",vstr(3,<x2(i),i,z2(i)>,",",0,5),"\r\r")
         #local U = U + Uinc;
      #end
      texture {
         uv_mapping
         pigment {
            brick rgb 0.15 rgb 0.2
            scale 0.04
            rotate 90*z
         }
      }

>>> snip >>>

I hope this helps, or at least gets you going in the right direction.


Kyle


Post a reply to this message

From: Zoly
Subject: Re: Bricked vault
Date: 12 Nov 2006 07:20:00
Message: <web.45571062718327621f6a4e110@news.povray.org>
My hat is absolutely off to you, Kyle. Thank you for your help and your
understanding of my code.

I have posted in povray.binaries.images how looks your solution in my (still
beta) Chartres Cathedral 'stone by stone' reproduction. There are still
pending the textures, ornaments ambient and lighting.

Rgds,
Zoly


Kyle <hob### [at] gatenet> wrote:
> Zoly,
>
> Here's my suggestion:
>
> >>> snip >>>
>
>    #local U = 0;
>
>    mesh {
>       #local i=h;
>       #while (i>0)
>          #local a_i=i;
>          #local i=i-dl/sqrt(1+pow((fr1(i)-fr1(i-dd))/dd,2));
>          #local Uinc = abs(vlength(<x2(a_i),a_i,z2(a_i)>-<x2(i),i,z2(i)>));
>          triangle {
>             <x1(a_i),a_i,z1(a_i)> <x2(a_i),a_i,z2(a_i)> <x1(i),i,z1(i)>
>             uv_vectors <U,z1(a_i)> <U,z2(a_i)> <U+Uinc,z1(i)>
>          }
>          #debug concat("T1: ",vstr(3,<x1(a_i),a_i,z1(a_i)>,",",0,5))
>          #debug concat(" - ",vstr(3,<x2(a_i),a_i,z2(a_i)>,",",0,5))
>          #debug concat(" - ",vstr(3,<x1(i),i,z1(i)>,",",0,5),"r")
>          triangle {
>             <x2(a_i),a_i,z2(a_i)> <x1(i),i,z1(i)> <x2(i),i,z2(i)>
>             uv_vectors <U,z2(a_i)> <U+Uinc,z1(i)> <U+Uinc,z2(i)>
>          }
>          #debug concat("T2: ",vstr(3,<x2(a_i),a_i,z2(a_i)>,",",0,5))
>          #debug concat(" - ",vstr(3,<x1(i),i,z1(i)>,",",0,5))
>          #debug concat(" - ",vstr(3,<x2(i),i,z2(i)>,",",0,5),"rr")
>          #local U = U + Uinc;
>       #end
>       texture {
>          uv_mapping
>          pigment {
>             brick rgb 0.15 rgb 0.2
>             scale 0.04
>             rotate 90*z
>          }
>       }
>
> >>> snip >>>
>
> I hope this helps, or at least gets you going in the right direction.
>
>
> Kyle


Post a reply to this message

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