On Dec 16 2004, Wookey wrote:

> +++ Stacho Mudrak [04-12-16 10:07 +0100]:
> > >It's easier :-) , but it will look worse :-(
> > >
> > > We do need to solve this problem somehow. Current rock-drawing is > > 
> > > super-slow, but I want my finished rocks to look realistic as well > > 
> > > (i.e. not sticking through the walls).
> > > MartinS has found a dirty trick how to solve this problem, so now it > is 
> > > just a question of implementation. :) In any case, we would welcome > a 
> > > good example (or even an algorithm), how those random blocks should > 
> > > look like...
>
> Take a look at the tunnel code. That is a nice implementation. I think there 
> have actually been two. The original one let you draw a 'gradient line' 
> across an area which indicated that rocks should get smaller in the direction 
> of the line, and there were several sizes of rocks. Then rocks were drawn so 
> that small rocks would stay on top of large rocks if they fitted on top. 
> Something like that anyway. One problem with this was that is was very slow 
> to render, so I think current tunnel has a slightly different scheme - anyone 
> on this list moreuptodate than me?


I have been using tunnel to draw up caves.  The rock and sand symbols will be 
recoded again in a little while.  I believe the current implimentation, 
randomly puts down symbols, and checks if they are in the area and if they 
overlap any other symbol already there.  The symbols themselves have clear 
outlines around them.  As these outlines can not overlap, the symbols will not 
get too close to each other.  User options tell tunnel wheather to allow 
bolders to randomly rotate the bolders, and by how much to randomly scale them. 
 Ordering is important, although not well implimented, so that more important 
symbols such as slopes are put down before bolders.  I believe futher 
optimisation is planned by creating a bitmap that records free areas.  So to 
choose where to put down the sybol, it can be checked against a bitmap to see 
if it will fit there, before clipping the different shapes together, which is 
more computationaly expensive.

To get nice looking bolders, it is worth drawing a few different shapes, so 
typically I use a quadraleral bolder and a triangular bolder.  Ideally which 
bolder is placed should be done randomly.  But at the moment all the 
quadralerals are placed first, and then the triangles are placed.

Tunnel can be found at http://www.goatchurch.org.uk/tunnelx/
I suspect that the executable provided is out of date, so you are better of 
downloading the source from cvs and compiling it yourself.

Examples of output are at: 
http://cucc.survex.com/expo/smkridge/204/surveys/plan2004.png

I believe Wookey may also be refering to a pull back feature, where by somehow 
sybmols can be pulled back to a line.  I do not use this, but understand it iis 
to do with trying to make walls of boulders, or sticking stals into ceilings.

Cheers,
Martin



Reply via email to