POV-Ray : Newsgroups : povray.binaries.images : dry stone wall - getting there.... Server Time
18 Nov 2024 12:19:28 EST (-0500)
  dry stone wall - getting there.... (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Tom Melly
Subject: dry stone wall - getting there....
Date: 11 Apr 2002 10:25:02
Message: <3cb59cbe@news.povray.org>
For some reason this was causing me a lot of grief. Started from scratch and
seem to be getting somewhere.... A better approach, and it was easy to get it to
follow the shape of the land.

--
#macro G(D,E,F)#local I=array[3]{D,E,F}#local B=0;triangle{#while(
B<3)#while(I[B])A[mod(I[B],10)]+#local I[B]=div(I[B],10);#end<-5,-
2,9>#local B=B+1;#end}#end #local A=array[7]{x,x*2,x*4,y,y*2,y*4,z
}light_source{-x*6-z*9,1}mesh{G(105,10,146)G(105,246,10)G(105,56,
146)G(105,1256,246)G(1256,126,220)G(22156,2216,201)pigment{rgb 1}}//TM


Post a reply to this message


Attachments:
Download 'dw2.jpg' (27 KB)

Preview of image 'dw2.jpg'
dw2.jpg


 

From: Christoph Hormann
Subject: Re: dry stone wall - getting there....
Date: 11 Apr 2002 11:40:17
Message: <3CB5AE5D.FF2C063@gmx.de>
Tom Melly wrote:
> 
> For some reason this was causing me a lot of grief. Started from scratch and
> seem to be getting somewhere.... A better approach, and it was easy to get it to
> follow the shape of the land.
> 

Nice, but the individual stones look a bit too uniformly oval, it's
probably difficult to build a wall with more irregularly formed stones,
but you could try blob-like shapes.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 18 Mar. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tom Melly
Subject: Re: dry stone wall - getting there....
Date: 11 Apr 2002 11:50:23
Message: <3cb5b0bf$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3CB### [at] gmxde...
>
> Nice, but the individual stones look a bit too uniformly oval, it's
> probably difficult to build a wall with more irregularly formed stones,
> but you could try blob-like shapes.
>

Oh - that's not really a problem. Each stone is a different iso-surface, just
not different enough yet. The main problem is some merging of seperate stones,
but I don't think that's going to show up.

Here's the code so far (God, I love trace):

#version 3.5;

#include "colors.inc"
#include "functions.inc"
#declare Rand1 = seed(4325);

global_settings {
  assumed_gamma 1.0
}
camera {
  location  <0.0, 1.5, -50>
  look_at   0
}
light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}
#macro MakeWall(WallLen, WallHi)
  #declare BestY = 0;
  #declare Wall = object{WallGround};
  #declare Building = true;
  #while(Building)

    #declare FRandX = rand(Rand1) + 0.5;
    #declare FRandY = rand(Rand1) + 0.5;
    #declare FRandZ = rand(Rand1) + 0.5;
    #declare FRandS = rand(Rand1) + 0.5;

    #ifdef(fn_Brick)
      #undef fn_Brick
    #end
    #declare fn_Brick =
      function(x,y,z) {x*x + y*y + z*z - 1 +
f_noise3d(x*3*FRandX,y*3*FRandY,z*3*FRandZ)/(5*FRandS)}
    #declare WallBrick =
    isosurface {
      function { fn_Brick(x, y, z) }
      contained_by { box {<-2,-2,-2>,<2,2,2>}}
      accuracy 0.001
      max_gradient 5
      pigment{LightGray}
    }

    #declare BestY = 100000000;

    #declare XScale = rand(Rand1)*1/1 + 0.5;
    #declare YScale = rand(Rand1)*1/2 + 0.5;
    #declare ZScale = rand(Rand1)*1/2 + 0.5;

    #declare Brick = object{
      WallBrick
      scale<XScale, YScale, ZScale>
    }

    #declare TraceX = 0;
    #while(TraceX <= WallLen)
      #declare Start = <TraceX, 2*WallHi, 0>;
      #declare InterA = trace (Wall, Start, <0, -1, 0>);
      #declare InterB = trace (WallGround, Start, <0, -1, 0>);
      #if(InterA.y-InterB.y < BestY)
        #declare BestX = InterA.x; // + XScale*0.75;
        #declare BestY = InterA.y;
      #end
      #if(InterA.y-InterB.y > WallHi)
        #declare Building = false;
      #end
      #declare TraceX = TraceX + (2*XScale);
    #end
    #declare Wall = union{
      object{Wall}
      object{Brick translate<BestX, BestY + YScale, 0>}
    }
  #end
#end

#declare fn_Ground = function(x,y,z) {y-sin(x/5)/1}  // cylinder function
#declare WallGround =
isosurface {
  function { fn_Ground(x, y, z) }
  contained_by { box {<-5,-1,-50>,<125,1,5>}}
  accuracy 0.001
  max_gradient 5
  pigment{Green}
}

#declare WallLen = 120;
#declare WallHi = 10;
MakeWall(WallLen,WallHi) object{Wall translate x*(-WallLen/2)}


Post a reply to this message

From: Defective
Subject: Re: dry stone wall - getting there....
Date: 11 Apr 2002 16:07:47
Message: <3cb5ed13@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3cb5b0bf$1@news.povray.org...
> "Christoph Hormann" <chr### [at] gmxde> wrote in message
> news:3CB### [at] gmxde...
> >
> > Nice, but the individual stones look a bit too uniformly oval, it's
> > probably difficult to build a wall with more irregularly formed stones,
> > but you could try blob-like shapes.
> >
>
> Oh - that's not really a problem. Each stone is a different iso-surface,
just
> not different enough yet. The main problem is some merging of seperate
stones,
> but I don't think that's going to show up.
>
Do these stones look better?

Hope you solve the merging stones issue soon...I can't wait to build the
perimeter wall in my ongoing homestead project with this.  (It'll take weeks
to parse, but what the heck... :)

Scott


Post a reply to this message


Attachments:
Download 'Stone Wall!2.png' (89 KB)

Preview of image 'Stone Wall!2.png'
Stone Wall!2.png


 

From: Shay
Subject: Re: dry stone wall - getting there....
Date: 11 Apr 2002 17:11:08
Message: <3cb5fbec@news.povray.org>
Definite improvement. Still a lot of overlap, however.

 -Shay

Tom Melly <tom### [at] tomandlucouk> wrote in message
news:3cb59cbe@news.povray.org...


Post a reply to this message

From: Corey Woodworth
Subject: Re: dry stone wall - getting there....
Date: 11 Apr 2002 22:12:06
Message: <3cb64276@news.povray.org>
only 2 things I see wrong is the top layer should be smoother, and they all
look like peanuts :)

Corey


Post a reply to this message

From: Tom Melly
Subject: Re: dry stone wall - getting there....
Date: 12 Apr 2002 07:04:57
Message: <3cb6bf59$1@news.povray.org>
"Defective" <def### [at] rogerscom> wrote in message
news:3cb5ed13@news.povray.org...
>
> >
> Do these stones look better?
>

Ooo, nice. I suspect for my needs I need to hunt down some ref. photos.

> Hope you solve the merging stones issue soon...I can't wait to build the
> perimeter wall in my ongoing homestead project with this.  (It'll take weeks
> to parse, but what the heck... :)
>

I don't know if the merging stones problem can really be resolved* - at least
not without a huge chunk of flaky code. What size are your base stones? At the
moment the macro only really works with stones w/ radius =1.

* changing the line
#declare TraceX = TraceX + (2*XScale);
to, for example
#declare TraceX = TraceX + (3*XScale);
would make a merge less likely in the x dimension.


Post a reply to this message

From: Defective
Subject: Re: dry stone wall - getting there....
Date: 12 Apr 2002 15:15:03
Message: <3cb73237$1@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3cb6bf59$1@news.povray.org...
>
> Ooo, nice. I suspect for my needs I need to hunt down some ref. photos.
>

I ripped the following rocks from isocacti.pov (in the sample scenes) and
created a macro, then plugged it into your code:

#macro Rock3(SEED)
    #local RS = seed(SEED);

    #local RockColors = array[5]
    {
     color rgb < 0.5, 0.4, 0.35>,
     color rgb < 0.4, 0.5, 0.4>,
     color rgb < 0.8, 0.75, 0.65>,
     color rgb 0.8,
     color rgb 0.5
    }

    #local TexNum = RRand(0.1, 1, RS);
    #local Scale = rand(RS);
    #local RotY = rand(RS);

    isosurface {
     function {f_r(x, y, z) - 1 + f_noise3d(x, y, z)*0.5}
     threshold 0
     contained_by {sphere {o, 1}}
     #if(Scale < 0.5) scale VRand_In_Box(< 1, 0.9, 1>, < 2, 1, 3>, RS) #end
     rotate y*RotY*360
     translate -y*0.35
     texture {
      pigment {Rand_Array_Item(RockColors, RS)*TexNum}
      normal {granite bump_size 0.5 scale 0.01}
     }
    }
#end // Rock3

>
> I don't know if the merging stones problem can really be resolved* - at
least
> not without a huge chunk of flaky code. What size are your base stones? At
the
> moment the macro only really works with stones w/ radius =1.
>
> * changing the line
> #declare TraceX = TraceX + (2*XScale);
> to, for example
> #declare TraceX = TraceX + (3*XScale);
> would make a merge less likely in the x dimension.
>

Trying that as I type this...

Dang!  No improvement.  Guess I better take another look at the rock
dimensions.

Scott


Post a reply to this message

From: Alf Peake
Subject: Re: dry stone wall - getting there....
Date: 12 Apr 2002 16:50:16
Message: <3cb74888@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3cb6bf59$1@news.povray.org...
> "Defective" <def### [at] rogerscom> wrote in message
> news:3cb5ed13@news.povray.org...
>
> I don't know if the merging stones problem can really be resolved* -
at least
> not without a huge chunk of flaky code. What size are your base
stones? At the

Look for a thread around early Jan 2001 in this group from Tor Olav
Kristensen re antiblobs. His file put similar sized blobs together
like soap bubbles or cobble stones - that is, they didn't merge. I
seem to remember he also put a file in p.b.s-f or p.t.s-f

Alf


Post a reply to this message

From: Sir Charles W  Shults III
Subject: Re: dry stone wall - getting there....
Date: 12 Apr 2002 18:14:57
Message: <3cb75c61@news.povray.org>
Yes, anti-blobs are likely a perfect solution for this.  Use a macro that
makes stretched anti-blobs as the basic shapes, and "tessellate" the wall with
them.  Maybe you could even place a bounding sheet against it.  Once made, you
can even choose to make a box of "mortar" if you have large enough gaps.
    Playtime!

Cheers!

Chip Shults
My robotics, space and CGI web page - http://home.cfl.rr.com/aichip

light_source{0#macro k(_)sphere{13*z+i*_.5pigment{agate}finish{phong.3}}#end
1}#macro _(s,i,g)#if(s)k(1)k(-1)_(s-1i+g,g)#end#end _(3x+3*y<2,-2>)_(2x,y)_(
2x-y,x)_(4x*3,-y)_(4<3,1>x)_(2x*6,-y)


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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