GeoTree: Procedural Trees in Geometry Nodes

Hey, does anyone have a particularly good twig and leaves texture they’re interested in trying out? Do you mind uploading it for me to test out if you do?

It may not look like much, but this is actually kind of a big deal for me…

But I’ve once again ran into the same problem I had once before, where all coordinates are local, so X, Y, and Z are different for every other branch…

Any idea how to, say, reset the coordinates so they all have the same local values?

1 Like

Have you tried the unchecking the local space in the rotate instances (or using a second rotate instance node with local space unchecked, if you want to retain the first rotation)?

Yeah, it scatters all the parts of the tree off in a way that’s not at all controllable or easy to predict.

…maybe I should try to play around with curve tilts again.

Yea I thought it might do something silly. I think it also will depend on how your stems are made if they are 2-3 point you could simply change the “position” of the tip vert/point.

Edit:

Maybe this is due to the pivot point, if you set the pivot point to the base of the stem it could help.

Having every other one inverted could work, yeah, but I can’t help but feel that that’ll probably cause more problems further on.

There’s gotta be an easier solution to this that we’re not seeing.

Can you share a simple example to play with?

1 Like

Here’s where I’m currently at.

I think my next step is to use a modulo to select every other point on curve, then set its tilt to 180 degrees. Then, I’ll have to set it up so that you can use the normal swirl placement, or that depending.

GeoTreeR_0.52.1.zip (2.3 MB)

Quick question and i think this importent :grinning: : Any reason why the normal flips if you use a simple curve bend deformer ?

  • For example if you make a leaf with a v shape the direction of the shape flips if you bend the leaf
  • Or if you add some noise to a spline then again from time to time the normal flip and you get a complete other distribution etc …
  • Or if you animated a spline you have again the same problem etc…
  • Is there a simple solution for ? Or do i see this complete wrong ? :grinning:
  • What do you guys think ?

1 Like

I don’t think that’d work. You’d have to stretch the hell out of each point on the curve to get the resulting branches to face in the direction they need to be facing.

To explain what’s happening here, think of it like this…

I have my branches being spawned along the spline, like so:

Now, say I want to alternate things so every other branch is facing in the opposite direction.

As you can see, since I rotated those objects, it’s thrown their local axis off relative to the branches in their original position, so if I want to rotate them so they’re facing upwards, half will go up, but half will go down, since they’re all being rotated relative to their local Z axis.

@stray had a pretty solid solution to the problem, but it was a bit overcomplicated, and made everything else more difficult to work with.

So I’ve decided that it’s all a whole bunch of stupid. It’s something you’d think would be easy to solve, but it’s been an absolute pain to deal with. Being able to control the growth and direction of the branches depending on their position on the tree or limb has been the one thing I’ve most wanted to do, and the one thing that’s stumped me the most.

I think you have done amazing job with your tree setup :grinning: :grinning:
But for some reason the normal flips if you bend a curve , for me this feels like a bug with geomertynodes and is not related to your setup .

1 Like

For a few things related to trees I have done, I can tell you that one possibility is to use the Curve to Points node on a high-resolution spline and then delete random points before they are skinned (that way you could, in theory, just use the point’s index value with a modulo math node to set rotations). You still get the impression of random branching with perhaps more control over small details.

I used this less conventional method for twigs, and one side effect is that I can always find a seed that ensures a leaf at the edge of a twig instance.

The beauty of nodes is that there is often more than one approach to a problem if plan A does not work well.

2 Likes

The only even more simple thing I could think of: instead of rotating, scale to “-1” on the offending axis >=D It’ll probably just cause more problems later, but it’ll flip the axis and rotations would not require anything else. Probably. At least in a dead simple case.

3 Likes

To tell the truth it has taken me a long time to work out what is going on with your new setup.

One thing that totally confused me was that changing the rotation of the twigs also changed the rotation of the branches they instance from. In the end I realized that you are using the same node group (Branch axis) on different levels, so changing things inside it was changing the main branches as well.

I have not come up with a way to reset the rotations, maybe a different approach is better, as Ace_Dragon and StrayBillie say.

But as we already know different approaches have different drawbacks, each one has its own limitations!

I do remember this post:

I think it was basically the same problem.

1 Like

Maybe we need to set it up so that it spawns branches off the faces of its parent object, rather than from the underlying spline. That’d help spawn everything in its proper direction without having to screw up their various local axes, but it’d be harder to control where something does or doesn’t spawn.

You mean local x?
Your current setup calculates the branches in the negative y direction, right?
And the problem is the z axis is facing down? Then why dont you rotate them around their z axis in the first place?

3 Likes

One thing that has been in the back of my mind since the beginning is using mesh lines and converting to curves with radius at the end. The main advantage being extruding verts in “world” directions, also mesh lines can split (curves are linear).

Well hell. That worked.

I think the biggest issue here is that I’ve got too many rotation operations piled on top of each other, and it’s spawning objects that have their own axes that you have to contend with when rotating.

So, once again, I think I need to redo all my rotations from scratch. Simplify things a bit.

4 Likes

Case in point, here’s me rotating every other spline, each with their beginning and ends on the X axis, on the Z axis around it’s parent branch…

…you can see how it’s not intuitive in the least. The parent branch’s Z axis is pointing towards us, since that’s the direction it’s been spawned from the trunk, so it’s children branches are popping up on it’s relative X axis, which is Z in world coordinates.

Work needs to be done here. I’m pretty sure that half of my problem stem from me confusing myself by trying to build on top of this chaos.

2 Likes