Jump to content

How to create a center curve from points


aoisaki

Recommended Posts

Here's one way to define a spine curve along a spray of particles that have been hit.

 

-store the hit time as @firsttime

-normalise that, store it as @u

-quantize @u to the amount of points you want along the curve. now there's patches of points that share the same @u

-add prims by attribute @u, now you have little polyline islands that have the same @u value

-promote the average @P to prim, then back down as @Pavg

-set @P as @Pavg, fuse. Now each island has been collapsed to a single point at its average center

-sort these points by @firsttime so they're in order

-add prim, this will make the line

-smooth

 

 

pop_curve_center.hipnc

post-7292-0-24732500-1460379431.gif

Edited by mestela
  • Like 4
Link to comment
Share on other sites

Here's one way to define a spine curve along a spray of particles that have been hit.

 

-store the hit time as @firsttime

-normalise that, store it as @u

-quantize @u to the amount of points you want along the curve. now there's patches of points that share the same @u

-add prims by attribute @u, now you have little polyline islands that have the same @u value

-promote the average @P to prim, then back down as @Pavg

-set @P as @Pavg, fuse. Now each island has been collapsed to a single point at its average center

-sort these points by @firsttime so they're in order

-add prim, this will make the line

-smooth

 

 

attachicon.gifpop_curve_center.hipnc

wow!Thank you very much!

It's perfect!

Link to comment
Share on other sites

Here's one way to define a spine curve along a spray of particles that have been hit.

 

-store the hit time as @firsttime

-normalise that, store it as @u

-quantize @u to the amount of points you want along the curve. now there's patches of points that share the same @u

-add prims by attribute @u, now you have little polyline islands that have the same @u value

-promote the average @P to prim, then back down as @Pavg

-set @P as @Pavg, fuse. Now each island has been collapsed to a single point at its average center

-sort these points by @firsttime so they're in order

-add prim, this will make the line

-smooth

 

 

attachicon.gifpop_curve_center.hipnc

sorry for bothering you again.

 

How can i use this center curve to define the vector like the picture 2.

Link to comment
Share on other sites

-set each point normal to {0,1,0}

-get closest point on the curve (a)

-get the next point on the curve (a+1) 

-vector along the curve is b - a

-vector away from the curve for each point is a - @P

-add those vectors to @N, scale to taste

 

would need further refining no doubt, but that's the general idea. :)

 

pop_curve_center_normal.hipnc

 

post-7292-0-85846000-1460496365_thumb.gi

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

-set each point normal to {0,1,0}

-get closest point on the curve (a)

-get the next point on the curve (a+1) 

-vector along the curve is b - a

-vector away from the curve for each point is a - @P

-add those vectors to @N, scale to taste

 

would need further refining no doubt, but that's the general idea. :)

 

attachicon.gifpop_curve_center_normal.hipnc

 

attachicon.gifpop_spine_n.gif

wow! thank you very much!

you rock!

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