Jump to content

Particle emission velocity relative to object?

Recommended Posts

Hi - i have an animated tube emitting particles. I'd like them to emit outward and upward relative to the tube. When I add velocity to the velocity channels it adjusts their velocity relative to worldspace, rather than the local tube's "x" direction.


How can do this thing?




Link to comment
Share on other sites

Yes i think so.  To simply include the vectors / normals of the cylinder you have to type a ridiculous custom chunk of code. I would expect VEX like that for more complex tasks, but that seems a rather basic one, right?


Also I'm relatively new to it - so I'm sure you're right that it's getting better.  But over the last two years I've seen it change so dramatically it's hard to keep up!

Link to comment
Share on other sites

3 lines of simple vex code seems reasonable to me. That's less than you'd use in an equivalent maya particle expression, and much more performant. I broke it up across a few lines to add more control, and make it easier to read. Keep in mind that it'll work on any kind of geo, static or deforming, and always give you a velocity that's combed to point along the y axis. A few lines of code to do that doesn't seem ridiculous at all.


If you literally only need v to point along the axis of the cylinder, and no other purpose, then yeah, of course there's simpler ways to do that. Immediately after you create your cylinder, put down an attribute create sop with the following settings:


  • name:v
  • type: vector
  • value: 0 4 0

When you do your transforms and whatnot after the attrib create, v will always point down the length of the cylinder.


Another way would be to use a polyframe node to give you N, tangentu, tangentv, then copy tangentu (or tangentv) into v. Many ways to skin many cats in Houdini.

Link to comment
Share on other sites

I guess I'm just frustrated at trying to get up to speed on a convoluted program with shitty outdated docs, which requires code rather often...


But you do have a point there. And thanks for the code - i'll have it forever now!  

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.

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