POV-Ray : Newsgroups : povray.binaries.images : just messin around. [200k] : Re: just messin around. [200k] Server Time
1 Aug 2024 00:24:52 EDT (-0400)
  Re: just messin around. [200k]  
From: [GDS|Entropy]
Date: 27 Feb 2009 12:51:47
Message: <49a82833$1@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
news:49a802ec@news.povray.org...
>
> To tell the truth, I have a problem of how to declare the VectorArray, and 
> was stuck there. Other things came in the way then.

The vectorarray is just an array of random vectors. Just make sure that its 
size is the same as the ctr variable in the snowtest.

Here is a macro which will do the job nicely, as it is based upon the 
bounding box:

//-------
#local RsA = seed(3141592654);

//      RRand Macro by Chris Huff
#macro RRand(RS, Min, Max)
 (rand(RS)*(Max-Min) + Min)
#end

//      randVectorMM2 Macro by [GDS|Entropy]
//------
#macro randVectorMM2(Array,ctr,Min,Max,Object)
 #local vectorA = min_extent(Object);
 #local vectorB = max_extent(Object);
 #local i=0;
 #while (i<ctr)
  #declare Array[i] = <RRand(RsA, Min+vectorA.x, Max+vectorB.x),RRand(RsA, 
Min+vectorA.y, Max+vectorB.y),RRand(RsA, Min+vectorA.z, Max+vectorB.z)>;
 #set i=i+1;
 #end
#end

// call it like this and use sRandVectArray for the vectorArray input in the 
snow macro
// and use the snowcounter variable for the ctr input of the snow macro

#declare snowCounter = 500;
#declare sRandVectArray = array [snowCounter];
 randVectorMM2(sRandVectArray,snowCounter,-sFudgeFactor, sFudgeFactor, 
testObject)

//-----

> I just tested Gilles Tran's MakeSnow macro with my moss texture and got 
> this result. Not entirely convincing, but I only used a single layer of 
> moss. I think that with your macro something similar would be obtained.
>

Possibly. Might I see the test source? I might be able to do something with 
it.

With a slight modification, the image you posted looks a lot like trees from 
a great altitude... :)

It would also make great corrosion or rust if you changed the colors of your 
moss...even dirt or paint peeling off of a wall. Lots of possibilities I see 
there.

ian


Post a reply to this message

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