Jump to content

Help Aligning Grass with Vellum Grains Simulation


Recommended Posts

Hi everyone,

I'm trying to copy some grass onto the top of my Vellum grains simulation. However, the grass blades aren't aligning with the direction of the grains — they always point straight up instead of following the grains' orientation.

Does anyone know how I can make the grass follow the grains' axis properly?

 

Thanks in advance for your help!

Grain Grass.gif

Grain Grass_01.hip

Link to comment
Share on other sites

Hi Tesan,

I've downloaded and installed qLib, but I haven’t been able to find any clear documentation or guidance on how to use it.

Is there a simpler way to achieve this effect, or could you point me toward any resources that might help?

Thanks in advance!

Link to comment
Share on other sites

I just used last vex after simulation that you have in That file . For more advance Trick and Study if you search Grains orientation you gonna find some Studies on that Topic and Vex Codes.
@Masoud
 

image.png

image.png

Cond8rfff.gif

Link to comment
Share on other sites

Posted (edited)

I opened the "rolling_debris.hip" file and confirmed that the POP Solver already aligns particle orientation to the surface correctly, without requiring any additional code. What I actually need is the same behavior for Vellum Grains, but it seems that Vellum doesn't orient the particles properly by default.

I searched for "Grains Orientation" but couldn’t find any helpful tips. Since the Vellum solver doesn’t compute orientation by default, I manually applied an initial orient attribute before the solver. This stabilized the orientation, but now I need it to align properly with the animation.

ParticlesOrientation-ezgif.com-video-to-gif-converter.gif

Edited by Masoud
Link to comment
Share on other sites

I added the "up" and "orient" attributes before sim, and included these lines of code after it. The alignment has a little improved, but it's still not exactly what I need:

vector axis = v@v * v@up;
float angle = @Time * $PI;
vector4 spin = quaternion(angle, axis);
@orient = qmultiply(@orient, spin);

 

The issue is that the grain's orientation resets to its initial state after they reach to the rest (zero velocity).

Any ideas to improve it?

 

 

Particles Orientation.gif

Link to comment
Share on other sites

I just copied All from that file(rolling_debris )@Masoud without to take consider all attributes that have no Impact on your Setup. Just search "Grains Rotation" , you have some Vex solution and some Heavy Study on That Topic.


 

Mp.gif

Link to comment
Share on other sites

@hannes603 @Librarian

Converting the grains to a surface and extracting normals from it is a solid approach, but I’m specifically trying to achieve this effect using VEX code, as Tesan suggested. The issue is that when I implement his solution, it doesn’t produce the same results in my scene as it does in his.!

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