ICE woes: Getting point IDs for opposite side by raycast from normals

58 views
Skip to first unread message

Alan Fregtman

unread,
Jun 21, 2011, 1:41:57 PM6/21/11
to XSI Mailing List
Hey guys,

I'm doing something where I want to store a per-point attribute of the
point's opposite point ID. That is... imagine one mesh with two planes
close together with normals facing up and down. I basically want to
raycast along the inverted normals to find the opposite side, and
store the point ID of the closest point there, but in the original
index.

http://s3.darkvertex.com/hlinked/ice/ICE_failed_oppositePointIDs.gif
(As you can see, it's storing the same point ID instead of the opposite side's.)

Any ideas?
Cheers,

-- Alan

Guillaume Laforge

unread,
Jun 21, 2011, 1:55:09 PM6/21/11
to soft...@listproc.autodesk.com
Hi Alan,

This is because from your position, the first intersection found is the point itself.
Just move your position along the inverted normal using a very small factor and it should raycast until the next one ;)

Cheers

Guillaume

Alan Fregtman

unread,
Jun 21, 2011, 2:07:54 PM6/21/11
to soft...@listproc.autodesk.com
Hmmm, good idea, but I tried and still no luck: http://i.imgur.com/QS3kB.gif
Or did I do it wrong?

The red showvalues-nulls there is where it's supposedly emitting the
ray from, and the blue cones is the direction. It seems right, but
it's still not catching the right thing. (Raycast is in "Semi Line"
mode with Cutoff Distance disabled.)

Mathieu Leclaire

unread,
Jun 21, 2011, 2:25:22 PM6/21/11
to soft...@listproc.autodesk.com
Why don't you just use a Get Data  "ID" of the raycast location instead of a Get PointPosition and a Get Element Index?

-Mathieu

Eric Thivierge

unread,
Jun 21, 2011, 2:24:02 PM6/21/11
to soft...@listproc.autodesk.com
I thought ID was strictly for particles?

--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com

Alan Fregtman

unread,
Jun 21, 2011, 2:26:28 PM6/21/11
to soft...@listproc.autodesk.com
Mr.T is right. If I go inside the Get Point ID compound, self.ID is in red.

Anyway, that's not the problem. My raycast is not catching the correct
points regardless, but thanks for trying to help.

Guillaume Laforge

unread,
Jun 21, 2011, 2:27:57 PM6/21/11
to soft...@listproc.autodesk.com
Interesting :)

I just try it and it works getting the "VertexIndex" attribute but not using the "Get Element Index" like in your tree. I guess the "Get Element Index" return the index of the current location who is the "Self point". So it is not a bug.
Get the "VertexIndex" or a any custom  data should be ok. 
But your tree setup will not always work as you are using the point normal as a direction. Point normal is an interpolation of polynodes so in the corners you won't get expected direction.

my 1/2 raycast

Alan Fregtman

unread,
Jun 21, 2011, 2:29:18 PM6/21/11
to soft...@listproc.autodesk.com
This is in 2011. Wasn't VertexIndex new in 2012? :/


On Tue, Jun 21, 2011 at 2:27 PM, Guillaume Laforge

Bradley Gabe

unread,
Jun 21, 2011, 2:36:37 PM6/21/11
to soft...@listproc.autodesk.com
How about using a Closest Location query, except manipulating the input Point Position vectors by reflecting them in local space? This is easier to do if your object is symmetrical.

You could also try negating your point normals, moving the point position far beyond the opposite side of the mesh, then raycasting from those point positions via the original normal direction.

Alan Fregtman

unread,
Jun 21, 2011, 2:38:04 PM6/21/11
to soft...@listproc.autodesk.com
Yep, in 2012.

But I solved it by simply storing the Point ID from Get Point ID to a
custom attribute and reading that instead. Not sure why I didn't try
that sooner.

Getting the correct IDs now. Thanks guys. :)

Here's the working tree for anyone interested:
http://s3.darkvertex.com/hlinked/ice/ICE_oppositePointIDs.gif

Cheers,

-- Alan

Mathieu Leclaire

unread,
Jun 21, 2011, 2:43:44 PM6/21/11
to soft...@listproc.autodesk.com
Oh right... my bad. Set a custom ID using the Get Point ID before and then use that custom data in your location.

-Mathieu

Guillaume Laforge

unread,
Jun 21, 2011, 2:48:39 PM6/21/11
to soft...@listproc.autodesk.com
"VertexIndex" attribute is not the problem, the problem is to use "Get Element Index" on some "Self" Location and thinking that it will give the index of the data "stored" in the location. 
If you are not in 2012 you can create a custom Index attribute first and then get it after the raycast.
Reply all
Reply to author
Forward
0 new messages