Point In Volume In SDK?

Discussions concerning programming of SOFTIMAGE©
User avatar
claudevervoort
Posts: 89
Joined: 16 Oct 2009, 00:56
Location: Montréal, QC, Canada

Point In Volume In SDK?

Post by claudevervoort » 22 Aug 2011, 23:40

Hi,

I'm trying to replicate a bit of ICE logic into a C++ plugin and I'm wondering if there is an SDK equivalent for Point In Volume. I looked at the Geometry object and could not find anything like it.

Thanks!

Claude

User avatar
claudevervoort
Posts: 89
Joined: 16 Oct 2009, 00:56
Location: Montréal, QC, Canada

Re: Point In Volume In SDK?

Post by claudevervoort » 30 Aug 2011, 00:57

I looked a bit closer and did not find anything. So I thought actually - assuming a closed geometry - I could fire a ray or ask for the closest location and if it returns a triangle and if that triangle is outward-facing, then I can take the position is inside, and otherwise outside.

So I looked at the geometry object, and it seems it offers the functions I would need for that (like GetClosestLocations). However I do not see how to access the Geometry object from ICE.

The ICE node gives access to an CICEGeometry instance. Is there a way to get a Geometry instance from CICEGeometry? (somehow I feel that this is a restriction to prevent any undue modification of underlying geometry, but then it is loosing all the nice methods I would actually need.)

Any insight appreciated,

Thanks!

Claude

scaron
Posts: 119
Joined: 08 Jul 2009, 03:16

Re: Point In Volume In SDK?

Post by scaron » 30 Aug 2011, 05:19

ya, a first glance i see no way to go from CICEGeometry to the Primitive or the X3Dobject. In many ways they have exposed through factory nodes all of the GetClosestLocation functionality of the Geometry. if you can't use the factory nodes you will have to make your own raycasting functionality which does the hit test, but then you run into the issue of not having access to normals through CICEGeometry.

it sounds like you need to log a bug or feature request to expose more functionality to the CICEGeometry class.

here is a limited example of someone doing ray cast through c++ api... http://vimeo.com/9079156

s

User avatar
claudevervoort
Posts: 89
Joined: 16 Oct 2009, 00:56
Location: Montréal, QC, Canada

Re: Point In Volume In SDK?

Post by claudevervoort » 31 Aug 2011, 02:59

Thanks Steven, I looked at the video, but could not get much out of it that 'yes it's possible'.

If I can get some time, i'll give this DIY raycast a try, it sure can be a bit a good coding exercise, even if that feels like re-inventing the wheel when coding that for Softimage :)

Claude