0

I have cone->p (vertex of the cone), cone->orient (axis vector), cone->k (half-angle tangent), cone->minm and cone->maxm (2 height values, for cone caps). Also I have point intersection which is on the cone. How do I find the cone (side surface) normal vector at intersection point using only these parameters?

Anatoly
  • 25
  • 5
  • not an answer to your problem but see [Cone to box collision](https://stackoverflow.com/a/62257945/2521214) for some inspiration – Spektre Feb 24 '21 at 07:58

2 Answers2

1

Сame up with simpler method:

Find distance Dis from intersection point I to base P

Make axis orientation vector of length

D = Dis * sqrt(1+k^2)

and make point on axis at this distance

A = P + Normalized(Orient) * D

Now

Normal = I - A

enter image description here


Old answer:
Make orthogonal projection of point I (intersection) onto cone axis using vector `IP = I - P' and scalar (dot) product:

AxProj = P + Orient * dot(IP, Orient) / dot(Orient, Orient) 

Vector from AxPr to I (perpendicular to axis):

AxPerp = I - AxProj

Vector, tangent to cone surface, using vector product:

T = IP x AxPerp

Vector, normal to cone surface:

N = T x IP

enter image description here

MBo
  • 77,366
  • 5
  • 53
  • 86
1

If I is the intersection point on the cone's surface and you know its coordinates, and P is the vertex of the cone, whose coordinates you also know, then this is enough:

Normal = (axis x PI) x PI
Normal = Normal / norm(Normal)

where axis is the vector aligned with the axis of the cone.

Futurologist
  • 1,874
  • 2
  • 7
  • 9