POV-Ray : Newsgroups : povray.advanced-users : SplineTree and MakeSnow Server Time
26 Dec 2024 09:15:47 EST (-0500)
  SplineTree and MakeSnow (Message 1 to 2 of 2)  
From: Zarkoff
Subject: SplineTree and MakeSnow
Date: 15 Jan 2006 22:35:01
Message: <web.43cb145bcf04c11dbac2de490@news.povray.org>
I was trying to use Gilles Tran's MakeSnow macro on spline tree from
splinetree.inc and it only covered the trunk, not the branches.

Anyone else try this and run into same problem?

If someone knows the solution you can save me some time.

Here's some of the code I used:

//--------------------------------

////////////////////////////////////////////////////////
// Tree
////////////////////////////////////////////////////////

// Include the leaf definition and splinetree files
//#include "leafdefs.inc"
#include "splinetree.inc"

#declare recursionmax = 4; // Defines the complexity of the tree
#declare divisions = array[5] {6,4,4,3,3}
init_rand (79,168,497)     // Supply seeds to initialize the random variable

// Variables modeled exponentially
// Use: init_variable (start_size, end_size, base)
init_tdev (0.5, 0.9, 0.49)          //
init_rdev (30, 60, 1)               //
init_twigprob (0.03, 0.17, 0.15)    // probability of twig on (trunk,
branch, twig?)
init_branchl (2.2, 0.72, 0.79)      // (trunk length, branch length, ?)
init_branchw (0.43, 0.01, 0.45)     // width, thickness where?

// Odd variables
init_roots (2)   // Use: init_roots (rootrecursionmax)
init_splinedev (0.5,0.93) // Use: init_splinedev (min_dev, max_dev)   --
curviness --
init_simplify (4,6)  // Use: init_simplify (num_simplify_levels,
num_segments)

// Add some upwards tendancy
#declare tendancy = <0,0.3,0>;

// Variables for leaves
//#declare leafarray = array[3] {fallmaple1,fallmaple2,fallmaple3}
//#declare leafprob = array[3] {0.3,0.3,0.3}
//#declare leafscale = array[3] {0.15,0.15,0.15}
//#declare leafnoise = array[3] {1,1,1}

// Assign the branch texture
#declare branchtexture = texture { pigment {rgb 0} } // standard_branch is
defined in leafdefs.inc

// Define transformations assigned to the whole tree here.
#declare global_transform = transform {
 scale <1,1,1>
 rotate <0,0,0>
 translate <0,0.83,0>
}

// Provide feedback in the first 2 recursion levels
#declare feedback = 2;

// Call the macro
#declare daTree = splinetree(0,0)


object {daTree}


#declare Particles=800; // number of snow particles
//      More particles = more parsing time and smoother effect
//  macro loops until this number of "hits" is completed ("misses" do not
count).

#declare Size=0.14; // size of the largest snow particle
// Sizes between 2 and 100 should be OK for objects whose
// size is expressed in centimetres

#declare Thickness=0.13; // thickness of the particles
//
#declare MinHeight=-1; // snow starts falling from this height
//  ( 1 = max height of the object)
#declare MaxHeight=5.1; // snow stops falling from this height
//  ( 1 = max height of the object)
//  Using MinHeight < 1 makes it possible to have snow on lower parts
// of the object that are protected by overhangs, higher branches
// and such, but it may requires more particles to get a proper effect

#declare Direction=-y+x*-0.81+z*0.73;
// Direction of gravity, wind etc.(-y = vertical, no wind)
//    ---


#include "SnowCast.inc"
MakeSnow(daTree,Particles,Size,Thickness,MinHeight,MaxHeight,Direction)

//--------------------------------

Note that "SnowCast.inc" is really an extra copy of MakeSnow, no changes yet
-- thought I'm planning to do a re-write to melt objects in the future.


Post a reply to this message

From: Zarkoff
Subject: Re: SplineTree and MakeSnow
Date: 16 Jan 2006 00:30:01
Message: <web.43cb2efaaa1544d1bac2de490@news.povray.org>
"Zarkoff" <zar### [at] yahoocom> wrote:
> I was trying to use Gilles Tran's MakeSnow macro on spline tree from
> splinetree.inc and it only covered the trunk, not the branches.
>
> Anyone else try this and run into same problem?
>
> If someone knows the solution you can save me some time.
>
> Here's some of the code I used:
>
> //--------------------------------
> .... big snip ...
> // Call the macro
> #declare daTree = splinetree(0,0)
>
>
> object {daTree}
>
> ... next snip ...
> //--------------------------------

Never mind, I figured it out quicker than I thought.

The cure is to put the spline tree call in a union, like this:

#declare daTree = union {splinetree(0,0)}

Well, now you won't make my mistake.


Post a reply to this message

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