Jump to content

voxelfox

Recommended Posts

Hello all,

image.png.08e2995053462020f3aad6ffb7a46285.png

I have a built a rig that allows for the dynamic simulation of trees. I was able to define an instance point which is offset from the trees branches. This enables the copying of a packed leaf primitive onto the point. The next step is to update the rotation of the packed primitive. It seems like the copy to points has defaulted to using the z-axis (vector pointing in the {0,0,1} direction).

The tree includes a central wire which captures the deformation as it moves through space. I have been able to construct a normal by using the following logic:

  • Using a leaf point
  • find the closest point of the wire
  • compare point positions (@P{leaf point} - @P{wire point})
  • normalizing the compared vector   and setting an @N attribute

VEX CODE

image.png.1b6905883050238db2dee2808d76352e.png

However, when using this @N (normal) on the copy to point the leaf geometry picks up this @N (built above in vex) and discards the desired z-axis vector of {0,0,1}. Here is a diagram demonstrating the results.

Figure 1 -  This is the result of the vex code written above (visualized left), notice when using the vex code normal the leaf is unable to correctly orient itself to the point (visualized right).

image.png.6a29433d3577111101ca88d7f2e88676.pngimage.png.8e09f4276a59f33753955b0aca99eabf.png

The custom vex code normal is required to guide the orientation and the tree deforms. This is shown in the following .gif animation.


Figure 2  - A .gif animation demonstrating the updating normal as the tree deforms

VLM_sftbdyTrees_v023-250001-0120.thumb.gif.1d397f64b56f9e910f2d316333ec9338.gif

I have also tried adding an @up vector to see if that resolves the issue, however, that route is also producing me undesirable results.

image.png.170013575a6ff324d77d2ac1f59ea539.png

image.png.07f9c95be0cbbce54e2b1adf967b9248.png

 

I have though about using some form of quaternion or rotational matrix, however, I am currently studying these linear algebra concepts and I need time and guidance before fully understanding how to apply the knowledge in Houdini. Could someone please offer guidance in this regard. I am working on supplementary .hip file which should be posted shortly.

Warm regards,

Kimber

 

 

Edited by voxelfox
Link to comment
Share on other sites

Hello @tamagochy

Would you mind explaining this in more detail? What are the steps one should take to build the matrices and rotate the leaf instance in accordance with the deforming geometry?

 

Edit:

Not a problem. I've figured it out! I'll post an update with my results for anyone who's interested or needs this as a reference for their own setups.

Edited by voxelfox
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 5 months later...
On 2021. 01. 18. at 2:27 PM, voxelfox said:

Not a problem. I've figured it out! I'll post an update with my results for anyone who's interested or needs this as a reference for their own setups.

Hello Michael!

I'm very interested! :)

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...