POV-Ray : Newsgroups : povray.newusers : Creating moss or ivy? : Re: Creating moss or ivy? Server Time
30 Jul 2024 04:15:01 EDT (-0400)
  Re: Creating moss or ivy?  
From: Florian Brucker
Date: 20 Sep 2004 09:35:57
Message: <414edcbd$1@news.povray.org>
> Thank you! I think I will try this soon! Although I'm afraid, that my skills
> aren't good enough for changing a tree algorithm right now..

I'd go the other way round: Don't try to change a tree algorithm, but 
write one from scratch.

Here's a start-off:

<POV>
#declare SEED = seed(8390);
#declare MAX_LEVEL = 5;
#declare MAX_ANGLE = 35;

#macro Ivy(Level)
	union {
		cylinder { 0,y*2,0.1 }
		#if (Level<MAX_LEVEL)
			union {
				object { Ivy(Level+1) rotate z*(-MAX_ANGLE+2*rand(SEED)*MAX_ANGLE) }
				object { Ivy(Level+1) rotate z*(-MAX_ANGLE+2*rand(SEED)*MAX_ANGLE) }				
				translate y*2
			}
		#end
	}
#end

union {
	Ivy(0)
	pigment { rgb <1,0,0> }
}
</POV>

Things you could add are:
- random branch length
- random branch depth level
- leaves
- random amount of child-branches
- etc.


HTH,
Florian
-- 
Optimum Requirement #4: You virtualized yourself and want to rent a
room on one of our servers (WEB.DE help-wanted ad: Linux Guru)
[------------ http://www.torfbold.com - POV-Ray gallery ------------]


Post a reply to this message

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