POV-Ray : Newsgroups : povray.newusers : Using rand() Server Time
28 Nov 2024 17:45:43 EST (-0500)
  Using rand() (Message 1 to 4 of 4)  
From: Matthew Green
Subject: Using rand()
Date: 7 Jan 2000 00:36:03
Message: <38757B41.758B1703@netzero.net>
I've been trying to get something of a snow-topped mountain range, but I'm
having difficulty getting the snow to look even halfway natural.

I've got the mountains as a height field, and I thought I might be able to 
declare the snow as that same height field, raised just a hair, but with a
randomized waterlevel (ie. #declare s1=seed(1000); water_level 0.6+rand(s1)). 
However, as most experienced people already know and are laughing at me 
about at the moment is the fact that I do indeed get a random number, but I
only get ONE random number.  Thus, the bottom of the snow IS random, but
it's still completely straight regardless.

Is there a way around this?  A snowlevel that's perfectly even just don't
look right!  I'm looking for something a little more jagged.  Is there a 
way to do this with my scheme, or do I need to bag it and come up with
something else?  (And if I do, does anybody have any ideas?)

Thanks!
- Barelytone


Post a reply to this message

From: Kevin Wampler
Subject: Re: Using rand()
Date: 7 Jan 2000 02:11:43
Message: <387590B5.DE2E5010@tapestry.tucson.az.us>
The water_level function in Pov, as you have noticed, cuts off the height field
along a plane, so you can't get a jagged look.  There are two ways that I would
suggest to make the snow look good, both involve texturing instead of multiple
height_fields.  The first one is to create a y gradient texture_map
(interpolating between your rock and snow textures) for the snow, and scale it
so that the snow level on the height field is about what you want (it will still
look like a plane at this point)  Then add some turbulence to the texture to
make the snow line jagged.  The other method relies on the slope dependent
textures in Megapov, so it won't work in the official version.  The slope
dependent textures allow you to define how the texture changes depending on both
the slope and the altitude, so it is a very useful tool.  I have forgotten the
syntax, but it is quite easy to understand and get good results from.  Some pov
artists have created some very nice images that may help give you ideas, take a
look in p.b.i. under  SamualT.'s "Snowy Mountain: trace function (512x384)"
(11/13/99) and under Michael Andrews' "Isosurface snowscape ..." (9/01/99).  I'm
not sure if the source for either of these images has been posted, bit it's
probably worth checking.

Matthew Green wrote:

> I've been trying to get something of a snow-topped mountain range, but I'm
> having difficulty getting the snow to look even halfway natural.
>
> I've got the mountains as a height field, and I thought I might be able to
> declare the snow as that same height field, raised just a hair, but with a
> randomized waterlevel (ie. #declare s1=seed(1000); water_level 0.6+rand(s1)).
> However, as most experienced people already know and are laughing at me
> about at the moment is the fact that I do indeed get a random number, but I
> only get ONE random number.  Thus, the bottom of the snow IS random, but
> it's still completely straight regardless.
>
> Is there a way around this?  A snowlevel that's perfectly even just don't
> look right!  I'm looking for something a little more jagged.  Is there a
> way to do this with my scheme, or do I need to bag it and come up with
> something else?  (And if I do, does anybody have any ideas?)
>
> Thanks!
> - Barelytone


Post a reply to this message

From: Nieminen Juha
Subject: Re: Using rand()
Date: 7 Jan 2000 05:40:12
Message: <3875c28c@news.povray.org>
Of course you get only one water level because the value is parsed only
once.
  I think that what you are looking for is slope-dependant texturing, available
in megapov.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Tom Melly
Subject: Re: Using rand()
Date: 10 Jan 2000 10:13:47
Message: <3879f72b@news.povray.org>
If your snowline is essentially at a set altitude, then you should be able
to get away with a texture map based around the planar pattern with
turbulence. If you want something a bit more terrain dependant you could
take a look at my question from today (10/1/2000) in povray.binary.images
and Bill D's excellent solution and illustrated answer. I think the message
header is "hf question/help - melly".


Post a reply to this message

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