I did not get time go through Miquel's scene but here is way :-

Refer to this diagram:



Part I (Finding whether the point is inside cone)

This would be a better solution (found on web but the math seems right):

S1 - Vector for one side of the cone  = Vector p1 - vector p2
S2 - Vector for the second side of the cone = Vector p1 - vector p4
p3 - Point Vector to test

Take the vector S2-S1 and the vector p3-S1. Normalize them both to unit length. Take their dot product. If this number is greater than or equal to the **cosine of the half-angle at the apex of the cone, then the point is inside the cone. (If it's exactly equal, then P3 is on the cone.)

** cosine of the half angle at the apex of cone: Can be easily found in ICE by angle between vectors node for the vector (S1 & S2). Divide by 2 and then take a cos  of that.


Part II (Finding the distance of the point from the central line of the cone)
This one comes from me :)

B = vector p4 - vector p2
p5 = 1 /2 of B

L = p1 - p5

Find the distance between point p3 and vector B through ICE.

Cheers !


On 18/02/2013 11:02 AM, Alan Fregtman wrote:
Yes.

For a bone, we'd be considering a cone drawing it out the direction of the X axis of the bone's transform, knowing only its angle. Is the given global pos inside it? And if so, how far is it from the imaginary center line of said cone?



On Mon, Feb 18, 2013 at 10:54 AM, Alok <alok.gan...@modusfx.com> wrote:
Do you have a ICE Scene setup ? You are wanting to test a point (represented as a pos vector) in a cone whose two inclined lines are defined by a vector, right ?

On 18/02/2013 10:45 AM, Miquel Campos wrote:
Hello,

I struggling to found a method for test if a vector is inside a cone defined by two other vectors. For example for know if a point of a bended arm, is the internal part  or the external of the elbow.

Alan send me this link the other day, but I did not success getting anything working in ICE:  http://stackoverflow.com/questions/10768142/verify-if-point-is-inside-a-cone-in-3d-space

Someone have any idea?


Thank you for the help!!. :D

Miq
----------------------------------------------------

Miquel Campos
www.akaosaru.com

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2238 / Virus Database: 2639/5610 - Release Date: 02/17/13



No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2238 / Virus Database: 2639/5610 - Release Date: 02/17/13


Reply via email to