graphics - Gettting normal point on a Cone -
i'm trying cone primitives working in ray tracer. got intersections of cone , ray working. however, not know how normals of cone way cone defined. define cone following:
pos -- vertex of cone size -- height of cone direction -- unit vector defines direction of cone angle -- angle of cone
(for more info followed how intersection of line , cone reference on how defined).
from gather can use two tangents of point parametric eqn, , using cross product normal. don't know how parametric eqn given way defined cone, , 2 tangents parametric eqn.
if somehow has method find normals great to.
i ended applying grad function cone equation (x*a+y*b+z*c)^2-(a^2+b^2+c^2)(x^2+y^2+z^2)cos(t)^2
where
- {x,y,z} = 3d point (point of normal in question)
- {a,b,c} = direction vector
- t = angle of cone
then using wolframalpha, ends giving me
- x = (2 (a x+b y+c z)-2 (a^2+b^2+c^2) x cos^2(t))
- y = (2 b (a x+b y+c z)-2 (a^2+b^2+c^2) y cos^2(t))
- z = (2 c (a x+b y+c z)-2 (a^2+b^2+c^2) z cos^2(t))
and normal={x,y,z}
Comments
Post a Comment