Tree Generator as freeware. Panda3D and 3D Max

Heya!

[color=darkred]This is not directly Panda 3D related, but maybe some people are still interested in that. I wrote this little script for 3dsmax, it basiclly creates a simple tree.

[color=red]Update: Now it is actually directly Panda3D related.

Downloads:
EasyTree Generator for Panda3D.
Tree Generator for 3D Studio MAX.
Tree models in EGG-Format.

You can create all kinds of trees and you have quite some control over the amount of detail, so it will work for realtime aswell. The trees are normal poly objects, so they are easily tweaked, if you’re picky. They also come with a UV-set, so you can just throw a bark-texture on it and it should look kinda fine.

The controls for the tree are pretty self explanary:
Height is the height, radius is the radius of the trunk. Generations says how often branches, well, branch. Radius- and length-drop define how much the branches become thinner and shorter. A 0.5 value here makes a child branch half as thick or long as its parent. Spread angle and -rotation define how the branches spread out. The lower the values here, the straighter the tree will be. Spread Randomness and Rotation Randomness make it look more random, less straight. Segments and sides finally define the detail amount on the branches.

The function “rollDice” creates random values that produce more or less natural looking trees.

class tree:
	
	def __init__(self):
		self.height=1
		self.radius=0.3
		self.generations=7
		self.radDrop=0.6
		self.lenDrop=0.75
		self.spreadAngle=55.0
		self.rotationAngle=90.0
		self.spreadVar=30.0
		self.rotationVar=60.0
		self.segments=3
		self.sides=8
		self.model=None
		self.nodes=[]
		self.seed=0.1

Looks useful or fun to play around with since the branches are not connected. What version is it for? Does max scripts work across all version?

Can’t really say, i have no possibility to test it. It was developed on Max 2009 and i’m pretty sure it will work with 2008 aswell… i can’t guarantee anything for earlier versions :frowning:

I intend to add some further features aswell as time permits. Ideas are:

  • poly reduction for child branches
  • leaves
  • option for reducing branches from a certain generation to planes for even more low poly
  • joining of branches to one single shell
  • procedual bone system for animation

EDIT: I created some demo trees, feel free to take a look. They’re freeware too, so have fun.

Free Tree Samples in Panda3D format Download

(Textures are made using CGTextures.com.)

Dude! Pretty cool - thanks! Will definitely come in handy!

And btw - awesome avatar 8)

looks pretty good oli! but i cant test it, im not using max, how about a maya version?

BUMP this script!

can we get this ported to python and panda3d api instead?

Hmmm… i am using loads of maxscript functionality which would have to be reprogrammed in python… Ill give it a shot, but i won’t promise anything.

Okay, slowly but surely :wink: First tree’s straight out of python and panda3D:

There is no variation so far, but at least it sorta looks like trees.

Here is the download: Panda3D EasyTree Generator

Awesome! Thanx for porting it to panda3D! :smiley:

if I place this at the end of the easytree.py (in the generate() )

self.model.flattenMedium()

to reduce the number of nodes, it runs o so smooth… And even with 50 trees in the scene I’m still not loosing a single fps.

I’m still learning panda so this might be the wrong place to put this operation…

Thanx again!

nice. i’ll try it out when i come to level modelling :slight_smile:
keep up the work!

badoli, great job!

I’ll have a look at it when i get home.

Are you using the egg interface (EggData) or the pg interface (GeomWriter) ?

yes, awesome!

Thanks everybody! I’m glad u like it!

Thanks for the hint, i’ll check that… fyi and i’m still learning myself… :wink:

The geomwriter… i pretty much just created a poly-pipe-primitive (cylinder without top and bottom), which is duplicated. There are several issues with that approach anyways, i am thinking of some improvements already…

Nevertheless it tought me a lot about matrix transformation, so i already won something :wink:

Very interesting indeed - I’m interested in this project, as it could turn out to be what I’m looking for for a much-delayed project that I have in mind…

Either way, however, good luck with it! :slight_smile: