Jump to content

wire thickness (sparks like simulation)


Recommended Posts

Hi,

I have a simple simulation for sparks generation (plz see attached). Although I can generate the sparks and control their lengths as I wish, I cannot seem to know how to control their thickness, i.e. I want each spark to have a different size. I've tried three different method to vary the thickness but no works. In the setup, I use pop network to emit particles, then use add to create poly-lines for each spark, then:

-If I use wireframe node, I could not find any variable that changes the wire thickness per primitive, I've tried $PR but it does not work (the whole node gets reddish lines)

-If I use for each loop to scale each primitive alone, the transform node would scale the spark uniformly and although it's possible to try to orient the transform node with the spark such that it would be possible to scale the thickness only, it would require some math and I don't think it should be that "troublesome"

-If I use for each loop and generate each spark individually by sweep+skin, the circle that is used for cross section is outside the loop and it cannot be changed for each primitive!

 

Thanks,

 

sparks_thickness.png

laser_sparks_odforce.hip

  • Sad 1
Link to comment
Share on other sites

Hi Khaled,

 

The attribute you're looking for is width, it can control the render of a curve. You won't need to "skin" or make geo out of the curves in this instance if you're rendering with mantra.

 

So simplest way is in an attribute wrangle directly after the "add1" run over Primitives something like -

@width = fit01(rand(@primnum), 0.1, 0.5);

Then you can simply render them as curves, they will be flat (not round) but for most spark type fx i've found this to do the job

 

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

Thaaaaaaaanks guys for your help :) One last question: I thought that we could not use attributes in VEX code only (i.e. not in HScript), but obviously, I am mistaken, so my question: is it always the case that we can use @attributes in HScript OR this example is a special case?

Once more, thanks for your help :)

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