1
$\begingroup$

i have an object and a 3d direction vector and position for it . I would like to know how do i determine if a certain point X is in the space below the plan determined by my direction ?

Here is an image that i have drawn to make it more clear . In this image i've made the vector 2d

enter image description here

Please Help!

Regards, Aleandru Badescu

  • 0
    in my example rolls are not possible. That is why i've specified that it can rotate only up/down left/right2010-10-25

1 Answers 1

1

You have a point $x$, vector $v$, and also some vertical vector, pointing down. Lets call it $g$. If I have understood your problem correctly, your plane contains $(0,0,0)$ (or otherwise you can write $x$ in the coordinate system with origin on the plane), vector $v$, and a vector $w=v\times g$ --- horizontal vector, orthogonal to $v$. I want to interpret $x$ as a vector (from the origin to the point $x$). Then for some $\alpha\in\mathbb{R}$ vector $x-\alpha g$ is on the plane and $x$ is below the plane if and only if \alpha>0. We have $(x-\alpha g, v\times w)=0,$ $(x-\alpha g, v\times[v\times g])=0,$ $(x-\alpha g, v(v,g)-g(v,v))=0,$ $(x, v)(v,g)-(x,g)(v,v)=\alpha\bigl((g,v)(g,v)-(g,g)(v,v)\bigr),$ $\alpha=\bigl((x, v)(v,g)-(x,g)(v,v)\bigr)/\bigl((g,v)(g,v)-(g,g)(v,v)\bigr).$

  • 0
    I think in your code the pitch axis is not necessarily horizontal. I am not sure I have understood the meaning of your code, but I think you should take $r=ship.orientation.Right$, $\alpha=\pm (x, v\times r)$ in the case of vertical rotation and $\alpha=(x,r)$ in the case of horizontal one.2010-10-25