josiah
02-25-2007, 02:41 AM
I have three objects. I want to shoot a ray from a vertex of obj1 to a point helper, and get the intersection where the ray hits obj2.
local vertPos = getvert obj1 vertexSelection[i] -- get the position of the vertex on obj1
local rayTarget = obj3.pos -- this is the where to shoot the ray at (point helper)
local ShootRay = ray vertPos rayTarget -- shoot ray from vert to pointhelper
local TargetVect = intersectRay obj2 ShootRay -- try to get point where ray intersects obj2
Now TargetVect.pos should hold the vector where the ray hit obj2's surface.
I think rayTarget must be a direction, but how can I get a direction from the vert to the point helper that will work?
Thanks for any suggestions.
local vertPos = getvert obj1 vertexSelection[i] -- get the position of the vertex on obj1
local rayTarget = obj3.pos -- this is the where to shoot the ray at (point helper)
local ShootRay = ray vertPos rayTarget -- shoot ray from vert to pointhelper
local TargetVect = intersectRay obj2 ShootRay -- try to get point where ray intersects obj2
Now TargetVect.pos should hold the vector where the ray hit obj2's surface.
I think rayTarget must be a direction, but how can I get a direction from the vert to the point helper that will work?
Thanks for any suggestions.
