|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have a container A (not at the origin) and, inside this container, an
object B at a random location. Using trace() I want to determine what is
the closest distance between B and the boundary of A in the X-Z plane,
and use the normal of A at that (approximate) location to
Reorient_Trans() B.
My main problem is shooting rays around from B as I have trouble
rotating the ray direction vector around the local Y-axis. I experiment
with vaxis_rotate() but do not get consistent results as it seems that
the axis (always?) passes through the origin.
How should I write this code?
Thanks!
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I may have found the solution. See sample file in p.b.s-f
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I have a container A (not at the origin) and, inside this container, an
> object B at a random location.
Are there any limitations on the shape of A and B, or could they be
anything?
> Using trace() I want to determine what is
> the closest distance between B and the boundary of A in the X-Z plane,
Do you mean from some centre point of B, or from the surface of B? What
I think you want is the shortest line connecting the surface of A and B
that is in a plane parallel to the XZ plane? Is that right? That doesn't
sound trivial to me.
> My main problem is shooting rays around from B as I have trouble
> rotating the ray direction vector around the local Y-axis. I experiment
> with vaxis_rotate() but do not get consistent results as it seems that
> the axis (always?) passes through the origin.
I'm not sure exactly what you're trying (haven't analysed your code) but
you can always translate to the origin, rotate, then translate back
again to rotate around a specific axis.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11-3-2013 9:15, scott wrote:
> Are there any limitations on the shape of A and B, or could they be
> anything?
They can be anything.
> I'm not sure exactly what you're trying (haven't analysed your code) but
> you can always translate to the origin, rotate, then translate back
> again to rotate around a specific axis.
>
In fact, as the code in p.b.s-f shows, I solved the problem to my
satisfaction as further tests have shown me. Implementation is in a new
Urbanism scene. Thanks for you comments though :-)
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |