Test if particle is inside curve area...

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
milanvasek
Posts: 143
Joined: 09 Jun 2009, 12:12
Location: Czech Republic
Contact:

Test if particle is inside curve area...

Post by milanvasek » 06 Dec 2011, 23:10

hi. im sorry for a weird title. i have no idea how to call it. but please, could someone help me?
what i want to achieve is effect as on the first image but without creating that geometry from the curve. is there some way to calculate area within the curve and then find point in that area (well, below the area)?

now i have to make this:
Image

but i would just like to use the curve somehow:
Image
Milan Vasek
ceramic artist & softimage fan
http://www.milanvasek.com

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Test if particle is inside curve area...

Post by grahamef » 07 Dec 2011, 00:30

If you pretend that the curve points define a polygon, you can use one of the algorithms discussed here: http://en.wikipedia.org/wiki/Point_in_polygon. However, you might need to add a lot of points on the curve to get the desired smoothness.

This page discusses an algorithm using spline curves directly: http://alienryderflex.com/polyspline/.

Personally, I think it's a lot easier to create the extra polymesh geometry.

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: Test if particle is inside curve area...

Post by Mathaeus » 07 Dec 2011, 00:56

Cheap trick would be something like this. Of course this is not "inside curve", it's just what you see in ICE tree. By inverting the curve you invert the result, too.

milanvasek
Posts: 143
Joined: 09 Jun 2009, 12:12
Location: Czech Republic
Contact:

Re: Test if particle is inside curve area...

Post by milanvasek » 07 Dec 2011, 01:28

thanks a lot both of you.
Mathaeus, your solution does all i need! it's a great way to control areas without using tons of weightmaps etc. i added some turbulence to the last "greater than" node so it has irregular edge and here is a test... it will be cool addition to the scattering compounds set... thanks again :)
Image
Milan Vasek
ceramic artist & softimage fan
http://www.milanvasek.com

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: Test if particle is inside curve area...

Post by caledonian_tartan » 07 Dec 2011, 09:08

that's pretty cool. i just can't make it work with multiple curves
SI 2015 @ WIN7-64

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: Test if particle is inside curve area...

Post by Mathaeus » 07 Dec 2011, 14:47

caledonian_tartan wrote:that's pretty cool. i just can't make it work with multiple curves

If you mean ICE tree I've posted, it should work with multiple curves, let's say by grouping them with 'group geometry' node, plugging this into 'get closest location'...
However, tangents on curves should be oriented in the same way (clockwise, counter clockwise).
Also, method really doesn't like sharp corners on curves, or linear curves, as it rely on comparison of curve tangent and direction from particle to closest location on curve. These two vectors should be perpendicular as much as possible. Doesn't work for text, for example.
In real word, this is like looking at river and finding on *which side* on river you are, according to direction of water flow.

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Test if particle is inside curve area...

Post by rray » 07 Dec 2011, 15:57

Nice .. should be a great compound for someone to study how cross and dot product can be used.

Ps I see a "screenshot of the week" coming :D
softimage resources section updated Jan 5th 2024

Post Reply

Who is online

Users browsing this forum: No registered users and 44 guests