71 views
Skip to first unread message

pedro santos

unread,
May 25, 2014, 9:24:29 AM5/25/14
to Softimage Mailing List
Image

Expectations: Get an array of intersection points between sphere and curve so I can constrain a Null to it. Boolean Location, or something?

Later one maybe te something between two meshes, but I guess that will be a lot of points... so I'll just stick with a curve :)

Looked here: http://download.autodesk.com/global/docs/softimage2014/en_us/userguide/index.html?url=files/iceref_Get_Geometry_Sample.htm,topicNumber=d30e332031
Don't think any of those can help me. Any clues?

Cheers

pedro santos

unread,
May 25, 2014, 9:25:17 AM5/25/14
to Softimage Mailing List
Argh forgot about adding a subject... Got to love normal forums sometimes :)

Mathias N

unread,
May 26, 2014, 4:51:00 PM5/26/14
to softimage




I think this should do the trick.
As far as I'm aware there's no (simple) way to intersect a curve with a mesh, so we're left with generating a point representation and raycasting between each segment.

The above returns the intersect location on the mesh. If you want the location on the curve then you will have to use the UV location used to generated the position to interpolate the UV location of the intersect and feed that back into the UV to Location.

pedro santos

unread,
May 31, 2014, 7:20:03 AM5/31/14
to Softimage Mailing List
Hello Mathias
Didn't see any reply to this. Only now that I've checked "Sent Mail" to add more info, I've noticed your post. I will analyse it through replication. Thank you.

Looking forward to see if the curve moves if the Null position sticks to one of the intersections consistently. My solution below twitches between the top and the bottom position intersection.
At start I just wonder why  "pointposition" is not directly plugged into "Get Element Index", instead of coming from Generate Sample Set, since all you get from it are indices.

Anyways I have to replicate this to get a better grasp. Thank you!



Cheers

Mathias N

unread,
May 31, 2014, 10:49:07 PM5/31/14
to softimage
I don't know what you're using pb_MatrixFilter for (Never seen that compound before), but basically what you are doing is:  For each point on the curve you get the closest location on the sphere, output the closest position of the point that is the closest to the sphere. However, you are comparing the x/y/z values of the vector between the point and the closest location rather than comparing their DISTANCE. You want to plug the vector into a length node first.

The result of this operation will depend on which happens to be nearest to the sphere, so it's not really a usable solution. You must remember that getting the pointposition of a curve returns the CONTROL POINTS, not smoothed points along the curve.
____________

Here's my scene file (SI2013): http://mayulive.com/circlemeshraycast.scn

Using generate sample set to allow a single-threaded operation to be multithreaded has been covered on the list before: https://groups.google.com/forum/?hl=en#!searchin/xsi_list/multithreading$20tip/xsi_list/utMwDX74NSY/_tD3yA2UUAIJ

At the beginning of the ice tree we use UV to Location to get a number of smooth positions along the curve. UV to Location + array of values between 0-1 = object-context array of smoothed point positions along curve.

Normally could have each of these points get the vector to the next point in the array and raycast against the sphere to get our intersections. However, because the array is in the object context (just a long array of positions) this would be single-threaded. Softimage also has a tendency to crash if you try to plug multiple arrays into raycast (even in 2015). So instead of doing this we generate a sample set.
A sample set is essentially identical to a particle, in that each particle can store values separately from the other particles, and can be executed independently too. Generate Sample set will generate one of these "particles" for each item in the array of positions, then, using its own index, each sample will select the values of one of these points.

This takes of from this:

For object
            position 1
            position 2
            position 3
            position 4
            ...

To this:

For object
            Sample 1
                        position 1
            Sample 2
                        position 2
            Sample 3
                        position 3
            ...


We do the same for the vector from each position to the next position, and then we simply have each sample perform a single raycast operation. Building an array from this set of data gives us
an array of intersections along the curve. You will need to keep in mind that the order of these intersections will depend on the location of the first control point of the curve. The first intersection in the array will be the first intersection starting from CP0


pedro santos

unread,
Aug 4, 2014, 5:33:00 AM8/4/14
to Softimage Mailing List
Sorry for the much later reply!
This is a great scene! So much to learn from it. Now I understand why you used "Segment" in the raycast, so it start and a sample and stops at the next one :)
It still is not clear to me the why to pass the info to a sample set, probably because I never use ICE in pointclouds contexts, just Polymeshes. But I'll keep playing with it and will get there.

Many thanks!

--

http://i153.photobucket.com/albums/s202/animatics/probiner-sig.gif
Pedro Alpiarça dos Santos 
Animator  3DModeler  Illustrator 
>>  http://probiner.x10.mx/

Reply all
Reply to author
Forward
0 new messages