Martin B Posted October 3, 2016 Share Posted October 3, 2016 (edited) Hi there, I want to rebuild an old tree model that uses cards with opacity maps and swap them for geo. Conveniently each 'card' is a pyramid with the centre point next to the branch. So the idea is to find the centre point of each card by the fact that is has 4 edges connected to it while the outer points only have 3. Then average the vector between the centre and 4 edge points, which will give me an 'up' vector, which I can then use to rotate some geometry around it. How would you go about this? I'm fairly new to Houdini, so I know the steps I want to take but actually executing them is proving difficult. And assuming there's a few thousand leaves on the tree this has to be relatively economical to run. Should I instance geo onto the leaves (with random scale/offset/noise), or would using curves/fur make more sense? Its a pine tree kind of thing so has spines more than leaves. Below is a simplified version of what I'm trying to achieve. Thanks for any pointers. Cards on branch Replaced with geo. Edited October 3, 2016 by Martin B Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted October 3, 2016 Share Posted October 3, 2016 you can use the neighbours vop or vex function to get an array of each points neighbours test if a point has more than 3 neighbours with neighbourcount vop/vex function if it does, loop through its neighbours and average the direction vectors to get your normal vector if it doesn't, remove it. this will give you just the centers of your cards with the correct normal vectors that you can use to build the rest of your coordinate system. you also can delete the primitives after your operations Quote Link to comment Share on other sites More sharing options...
Martin B Posted October 4, 2016 Author Share Posted October 4, 2016 Thanks for the direction. I made some headway and learnt some cool stuff but ended up using a fur system straight on the branches. Its come out pretty good for what I need so going to go that route. Quote Link to comment Share on other sites More sharing options...
galagast Posted October 6, 2016 Share Posted October 6, 2016 Hi, hopefully you may still find this useful, I attached a file outlining the workflow David provided above. Inside, I also created temporary meshes based off the image you attached. Done with H15.5.607 Indie H15_leaf_swap.zip Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.