0
$\begingroup$

I have the normal of a plane and a vector. I want to project this vector onto the plane from a particular perspective (top-down).

Because I'm terrible at describing math terms, here are pictures of my problem.

The teal-blue line is what I'm currently calculating by doing a standard projection onto the plane, which is not what I want. It is the red line being projected onto the plane the capsule is standing on. It's hard to tell from the picture, but the red line is a flat vector and only spans the x / z axis.

View from an angle

As expected, a view directly onto the plane shows the red line is being projected - but not how I want.

View directly onto plane

What I want is to project the red line onto the plane from directly above. So from the point of view attached below the red line should be projected onto the plane, but from the top-down perspective - as you can see, this is different than regular projection (the teal-blue line).

Top down view

Hopefully I've described my question properly, any direction is greatly appreciated!

$\endgroup$
0
$\begingroup$

I will assume the capsule is at the origin.

Pick a point $(x^*,y^*,z^*)$ on the teal-blue line that is not the origin.

Find the "vertical" line that intersects this point. Concretely, this vertical line is the set of points of the form $(x^*, y, z^*)$ where $y$ is arbitrary.

You want to find the point where this vertical line intersects the plane. Concretely, you want to find $y'$ such that $(x^*, y', z^*)$ is orthogonal to the normal vector of the plane. This is an equation you can solve.

Then the "projection" you seek is the line connecting $(x^*, y', z^*)$ to the origin.

$\endgroup$
  • $\begingroup$ Thanks! You led me to the information I needed. Here's the formula that I used: given a normal 'n' and a vector 'v', (nx * vx) + (ny * ?) + (nz * vz) = 0; solve for ? $\endgroup$ – Jeffrey Cordova Aug 19 '18 at 16:00
  • $\begingroup$ @JeffreyCordova: You can use MathJax for formulae. Solving $$ n_x v_x + n_y v_y + n_z v_z = 0$$for $v_y$ is $$v_y = - \frac{n_x v_x + n_y v_y}{n_y}$$ $\endgroup$ – Nominal Animal Aug 20 '18 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.