Hi!
I’m having a problem with casting rays. I’m doing a simple project where I have a ground with different levels, and an object that will move around on the ground.
I’ve been looking at the Ray.getRayToTriangleIntersection() function. And here’s where I bump into problems.
So what I understand is that the first parameter is a vector3d with the position from where I wan’t to shoot the ray.
The second parameter is to where I want to shoot the ray, also a vector3d.
But what is the other three parameters? And what would I send to this function in my case?
I know where my object is, I know which direction I want to shoot. But I can’t wrap my head around the other three parameters I need to define.
Here’s the logic I’ve come up with so far.
var from:Vector3D = object.position;
var to:Vector3D = object.position;
to.y -= 100;
var intersection:Vector3D = Ray.getRayToTriangleIntersection(from, to, ?, ?, ? );
trace("intersection : " + intersection);
Would be very grateful for any help in the right direction.
Thanks!