point in volume

Discussions about SOFTIMAGEs© Interactive Creative Environment©
clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

point in volume

Post by clankill3r » 06 Nov 2012, 16:55

How can i get this point in volume to work?
I want to know which points of the small sphere are in the big sphere.
(the ice tree is on the big sphere)
Image

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

Re: point in volume

Post by grahamef » 06 Nov 2012, 17:33

Get rid of the Switch Context and plug small_sphere.PointPosition directly into Point in Volume. Then save the attribute as small_sphere.tmp instead of self.tmp.

clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

Re: point in volume

Post by clankill3r » 07 Nov 2012, 20:06

thanks, up to the next problem

i did this tutorial by paul smiths (awsome tutorial btw),
https://vimeo.com/19034079

basicly you can punch a object in another object and it leaves a dent.
It looks at the closest location for that.
However when the object moves in to deep at once then it can be that the closest position is not inside the original shape but outside of it.

To prevend that i want first to see what points are inside the shape and then choose either one of those points instead of any point of the object.

here i check for which points of the sphere are in the big sphere (called globe), as you can see that works fine.
Image

From the points of the globe that hit the small sphere, i want to bring those points to a position shown in the first image.
I have this, which must work i think but it doesn't...
Image

This is what i get when i disconnect "find closest in array" and the "if true".
Image
It should get one of the vectors i stored in sphere.insideGlobe right?

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: point in volume

Post by EricTRocks » 08 Nov 2012, 01:01

Find closest location in the inverse direction of the point normals. Probably use a raycast node instead so you can set the direction which would be [Get Point Normal] > [Multiply by Scalar: -1] > [Direction]
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

Re: point in volume

Post by clankill3r » 08 Nov 2012, 12:24

thanks, works like a champ.
Still i wonder why the above thing didn't work.

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: point in volume

Post by iamVFX » 08 Nov 2012, 12:31

If condition return true for points inside of a sphere. "If True" port has 0,0,0 vector value by default, those points were moved to global center.

clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

Re: point in volume

Post by clankill3r » 08 Nov 2012, 13:04

that's for the image where i broke the connection line.
What about the one where it reads the vectors from the other object? (2nd image)

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: point in volume

Post by iamVFX » 08 Nov 2012, 14:07

PointPosition is an per point attribute, it's not an array. You shouldn't change the context for arrays also. See this: Getting and setting data–understand data context, structure, and type