Jump to content

Dynamics on growing curves


c0y

Recommended Posts

Hi,

i'm currently working on a growing tree system, and I'd like to have some advices on the way I could achieve dynamics on this one.

grow_001.gif.b0dae03664697ac60eb0e369a23ce839.gif

1) Which method is the best with animated curves ? Wire Solver ? POP Grain ? other ?

2) I started with Wire solver, but I can't get my animated curves. It takes the first frame to process. So all points are in 0 pos.

Note : the way the tree grows is not poping points. It's moving points. All points are already created at the first frame, they're just stacking on top of each other and then move.

3) When I'm creating glue constraints, my target points and my goal points are not aligned (there is an offset). So when I start the animation, the points moves to the goal point's position. How can I keep this offset ?

tree_dynamics_001.thumb.jpg.7892e52859bfffe0602c433804e67547.jpg

So, I don't know... I have attributes on each points and primitives such as group levels, growth value, width, parent prim, etc.

I can already predict several problems :

1 : simulation with several points on top of each other. Maybe I can fix this by using my "growth_val" attribute (as long as my value is not equal to 1, it is excluded from dynamic, for example)

2 : dynamic simulation with animated curve length. May cause some issues on curve behavior with stiffness, etc.

3 : glue root points on a growing curve with dynamics...

I need to do this procedurally, so I can't split the branches by level...

Any help would be appreciated !

Thx ! :)

  • Downvote 1
Link to comment
Share on other sites

Thx Matt for your example file.
But your setup seems a bit difficult to adapt on mine.
The L-system has all points fused together, so your constraints are "natural".
In my setup, I have several branches onto a parent one, and the root is not aligned to a specific point. It only has parametric uvw coordinates.
Moreover, my growing system is not a scaling effect. All the branches has moving points that are stacked at the beginning of the sim, and progressively move to their final position.


I tried to create the intersect point on the curve, but since they are sliding on it, point number are always changing... impossible to constraint on it.

I've got 2 setup... but i'm stuck on both...


1) On the first one, i'm creating a vector param_uv and a posprim (its the same as sourceprimuv and sourceprim). I was thinking of using it to constraint the branches to these primuv coords, but I don't know how... I tried Sop Solver, but it's not working for now.

wiresolver_setup1.gif.416f76333f40072cf63115b863bec971.gif


2) On the second one, I used the nearest point of each root branch, and used it to constraint the branch. It's working but my problem in this setup is that the constraint are hard constraints : the branches doesn't keep the offset between them; they are snapped to the closest point. Is there a way to constraint my branch to the closest point and keep the initial offset ?

wiresolver_setup2.gif.942aa1c81e1248bee7e15298c17cea74.gif

if someone can help, here is a hip file with the incoming bgeo animation.

Thx !

dynamic_tree_grow_help_01.rar

Link to comment
Share on other sites

Tricky problem! had a closer look into wires, ran into many dead ends there, went back to grains.

This latest attempt I went back to the rope example from my wiki, and tried to repurpose it for your tree. It looks up the roots for each curve, and finds the closest other prim and corresponding uv point. In the sim I use that to lookup the correct P for that root, and snap it there. Doesn't look as nice as your second example (how are you doing that? would love to know!), but here's what I have anyway, might give you some ideas.

tree_grain_grow_v05_ropegrain.hipnc

tree_grow_v05.gif.28d8be78987b5d0f4899dded1b911adf.gif

-matt

  • Like 1
Link to comment
Share on other sites

I tried this one, too, but could only come up with a post-simulation solution. I originally tried converting the constraints to polylines but that didn't give me any options for an offset. In the process of doing that I was experimenting with capturing sourceprim and sourceuv values on the constraint network. Ultimately, I used those attributes post simulation to offset the branches to the correct position.

dynamic_tree_grow_help_01.hip

glue_to_vel.gif.gif

  • Like 2
Link to comment
Share on other sites

Hi guys, thx for your help files.

@mestela : my second example setup is in the hip file :) It takes for each piece the nearest point on the parent branch, and then I create 2 array lists (in details spreadsheet). It's because i'm using the wireglueconstraint to glue points together (with constrained points list and goal points list). the node takes automatically each point of the 2 lists and constraint them (if you have "constraint points" = 0 50 100 and "goal points" = 92 505 32, then point 0 is linked to point 92, points 50 to 505, and so on). The problem is that it doesn't keep the initial offset, so on the setup, you should get the intersection point before.

Thx Julian for your post-sim tricks to reposition. That's what I tried to do inside a sop solver in the dopnet. Because in my initial tree system I already have the parent (sourceprim) branch and the sourceprimuv. But right now the points don't snap properly to their goal points...

So I ran into a different way, inspired by the Peter Quint's tutorial on the rope bridge :

https://www.youtube.com/watch?v=zrLk8ks6xTU

In his setup, he uses the shelf tool to create the wire solver and the constraints, and to connect the vertical lines to the horizontal one, he creates zero-length-lines (2 points with attributes to connect points together).
I did the same setup, to create the constraint network system.
But, I don't understand why my constraints don't work ! I don't know why... (I don't have any guide appearing).
The only difference is that i'm working inside a dopnet, and in the tutorial Peter Quint is inside a AutoDopNetwork, outside the geometry node.
I don't know if I missed something in the options...

tree_growth_setup03_img01.thumb.jpg.1d27e73ca91ecbdae0e6f382f27990f5.jpgtree_growth_setup03_img02.thumb.jpg.bee3c716481c81a78d55632888de5a2b.jpg

dynamic_tree_grow_help_03.rar

Link to comment
Share on other sites

For wire constraints the name attribute on the points should match the name of the wire object in the DOP. To actually see the constraints in your network you need to rename the name attribute on the constraint points to something like 'wire' (instead of 'anchor' and 'root pts'). You then need to make sure the wire object in the DOPNET is also called 'wire'. Once you do that you'll see the constraint icons.

However, I think you might have merged a load of lone points in your merge3 node. These are referenced later on as anchors but they look like free floating points (i.e.not part of any primitive) so they just sink with gravity. Has the animation changed since the first iteration? It looks like branches slide up crossing many anchor points now which might be tricky (I think in previous versions the branches were always anchored to a fixed point)...

dynamic_tree_grow_help_03a.hip

Link to comment
Share on other sites

oh, I see now... the s@name in his setup correspond to the wireobject's name... thanks ! I didn't notice it.

Yes, you're right about the floating points. The idea was :

1) I duplicate my root points and I get the sourceprim (which is my posprim attribute) and the sourceprimuv (which is my param_uv).
2) Create my constraint network between the root point of each branch and the floating point (which have the same position)
3) use a sop solver to put the floating point to their sourceprim and sourceprimuv (simulated) - i forgot to activate a wrangle in the sop solver
4) then the branches automatically snap to the "anchor" floating point...

the strange thing is that the branches are falling down even if i'm using hard constraints...

I don't know if this is the right way to do it.
I guess that it's not possible to make loops in simulation dop ? for example : I have 3 levels of branches (0, 1 and 2). First run the simulation for level 0, then run the level 1 and snap the branches to their sourceprimuv, and so on.

dynamic_tree_grow_help_03b.hip

Edited by c0y
Link to comment
Share on other sites

I experimented with another method. The basic idea was to rebuild the curves and physically add anchor points.

So far, this is what I ended up with:
dynamic_tree_grow_help_02.gif.8de62be3bee2109dbf1ab36ca52a2ed1.gif

I used the file from your 2nd post.

The only odd thing I'm noticing is that it seems to simulate much slower for some reason. I'll try and troubleshoot the next time I have time to sit on this.

Houdini Indie 16.0.745 - dynamic_tree_grow_help_02_jeff.zip

  • Like 3
Link to comment
Share on other sites

Hi guys and thanks a lot for your help !

I went over with Julian's technic because the problem with reconstructing the curves (I tried it before without any success) is the sliding points, which are moving over others. I don't know if it's the same on 16.0.745, (i'm on 16.0.671) but the curves are not "clean". I mean : the connections between points go back (due to sliding points), and it will cause problems for the meshing.

dynamic_tree_grow_help_02_jeff_issue.thumb.jpg.2ac5e4b440ddaef86d2a15c6d933c2e5.jpg

Don't really know how to fix that while keeping the same point numbers. But your technique definitly work on a non-growing tree !

Whatever it be, thanks so much... i'm working on leaves know :) I'll post stuff later, ^^

thx

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...