So this could be a long one.
Basically my issue is this
Now what i’m doing is rotating an object so the 2 nearest faces of an object are parallel.
the issue is when you have a sphere basically against a non sphere.
Imagine if you rotated this object on the left, the hexagon, so that the face of it THE SOLID LINE goes though, was parallel.
You would get a parallel face. However if you casted from the object to the center of the black line object. you’d find that the rotation had basically made it so a new face had rotated around.
Basically everytime you rotate the object you get a new face to rotate.
The reason is because your not casting directly out your casting slightly up to the center of the object.
really if you casted to the nearest point of the object it’d work.
But i’ve no idea how to do that.
pretty much if the face of an object is long enough (the angle between each face is big enoguh)
it’s not an issue.
it find the right face even casting at an angle.
but for shallow angles it finds a new face everytime.
I’d like to cast from the center of object hexagon
to the nearest point on another ojbect.
but not the nearest vertex. cause thats the point at the top of the line or maybe at the bottom.
the nearest point in space.
can it even be done?
the line of course is actually a triangle (viewed side on, its actually a 3d triangle)
i can find the nearest triangle i’m confident but can i use some averaging of the 3 points of the trinagle to find the nearest point.
like in this case really for this 2d view what i want is to cast direciton (x,y)
where
x = object x - other object x
y = object y
i want to keep the same height
I’m not sure how to translate this into 3 dimensions however.

is it perhaps the x and z of the second objects position but the height of the first objects that will go in the direction of the closest point?
– sparkzbarca