|
|
|
Return to Panda Features in Development
by badoli » Wed Jul 29, 2009 12:19 pm
Heya!
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.
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.
- Code: Select all
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

Last edited by badoli on Wed Aug 05, 2009 3:38 am, edited 9 times in total.
-

badoli
-
- Posts: 29
- Joined: Sun Dec 14, 2008 4:37 pm
- Location: Graz, Austria
-
by fleshtheworld » Wed Jul 29, 2009 8:56 pm
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?
-
fleshtheworld
-
- Posts: 24
- Joined: Sun Dec 28, 2008 1:35 pm
-
by badoli » Thu Jul 30, 2009 12:50 am
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
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.)
-

badoli
-
- Posts: 29
- Joined: Sun Dec 14, 2008 4:37 pm
- Location: Graz, Austria
-
by s0ndeb0k » Thu Jul 30, 2009 3:26 pm
Dude! Pretty cool - thanks! Will definitely come in handy!
And btw - awesome avatar 
-

s0ndeb0k
-
- Posts: 11
- Joined: Sat Jun 13, 2009 10:25 am
- Location: Ghetto
by ditus » Thu Jul 30, 2009 6:00 pm
looks pretty good oli! but i cant test it, im not using max, how about a maya version?
BUMP this script!
is the idea of the lenov diing? no!
the aries is already on build 
-

ditus
- Troll
-
- Posts: 277
- Joined: Mon Oct 15, 2007 2:15 pm
- Location: moon
-
by treeform » Thu Jul 30, 2009 6:29 pm
can we get this ported to python and panda3d api instead?
-

treeform
-
- Posts: 2106
- Joined: Sat May 05, 2007 5:15 pm
- Location: SF, CA
-
by badoli » Mon Aug 03, 2009 1:27 am
treeform wrote: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.
-

badoli
-
- Posts: 29
- Joined: Sun Dec 14, 2008 4:37 pm
- Location: Graz, Austria
-
by badoli » Tue Aug 04, 2009 8:07 am
Okay, slowly but surely  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

-

badoli
-
- Posts: 29
- Joined: Sun Dec 14, 2008 4:37 pm
- Location: Graz, Austria
-
by s0ndeb0k » Tue Aug 04, 2009 1:43 pm
Awesome! Thanx for porting it to panda3D!
if I place this at the end of the easytree.py (in the generate() )
- Code: Select all
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!
Last edited by s0ndeb0k on Wed Aug 05, 2009 2:27 pm, edited 1 time in total.
"It takes a smart guy to play dumb." - Mr. T
-

s0ndeb0k
-
- Posts: 11
- Joined: Sat Jun 13, 2009 10:25 am
- Location: Ghetto
by Nemesis#13 » Tue Aug 04, 2009 5:51 pm
nice. i'll try it out when i come to level modelling
keep up the work!
-

Nemesis#13
-
- Posts: 1040
- Joined: Mon Aug 04, 2008 8:09 pm
- Location: Germany
by treeform » Tue Aug 04, 2009 6:24 pm
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) ?
-

treeform
-
- Posts: 2106
- Joined: Sat May 05, 2007 5:15 pm
- Location: SF, CA
-
by ditus » Tue Aug 04, 2009 11:32 pm
yes, awesome!
is the idea of the lenov diing? no!
the aries is already on build 
-

ditus
- Troll
-
- Posts: 277
- Joined: Mon Oct 15, 2007 2:15 pm
- Location: moon
-
by badoli » Wed Aug 05, 2009 3:16 am
Thanks everybody! I'm glad u like it!
s0ndeb0k wrote:I'm still learning panda so this might be the wrong place to put this operation...
Thanks for the hint, i'll check that... fyi and i'm still learning myself...  treeform wrote:Are you using the egg interface (EggData) or the pg interface (GeomWriter) ?
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 
-

badoli
-
- Posts: 29
- Joined: Sun Dec 14, 2008 4:37 pm
- Location: Graz, Austria
-
by Thaumaturge » Wed Sep 23, 2009 3:25 pm
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! ^_^
MWAHAHAHAHA!!!
*ahem*
Sorry.
-

Thaumaturge
-
- Posts: 682
- Joined: Sat Jun 07, 2008 6:34 pm
- Location: Cape Town, South Africa
-
Return to Panda Features in Development
Who is online
Users browsing this forum: No registered users and 0 guests
| | |