Vector projection to other vector

  • Thread starter Thread starter twoski
  • Start date Start date
  • Tags Tags
    Projection Vector
twoski
Messages
177
Reaction score
2
Let's say i have 2 arbitrary vectors in a 3d space. I want to project Vector A to Vector B using a specified normal.

edit: better image

PQh2BdO.png


A is green, B is red, C is red arrow. Blue is result.

In this case, i want to project green vector to red vector in the red direction. This would give me the blue vector as a result.

I'm working in unity and they have a projection function, but it doesn't operate how i want it to... So i guess i need to make my own.

Here is the projection function they do have: https://docs.unity3d.com/ScriptReference/Vector3.Project.html
 

Attachments

  • nlUJHEW.png
    nlUJHEW.png
    5.9 KB · Views: 415
  • PQh2BdO.png
    PQh2BdO.png
    1.5 KB · Views: 797
Last edited:
  • Like
Likes Delta2
Technology news on Phys.org
The drawing is really bad. Can you try to explain what are you trying to do mathematically ?

As I understand you have three vectors, ##\vec {A},\vec {B},\vec {C}## you want to project ##\vec {A}## on ##\vec {B}##. on direction ##\vec {C}## ?

Isnt it the same as A projection on C ? Since A projection on B gives you a vector on B direction and then you want to project it again on C ?

If this is true I can help you with the code part. I guess at least for the math part.
 
Sorry that's not a great picture. A and B are 2 vectors in a 3d Space. I want to project Vector B to Vector A in a given direction, ie. Normalized Vector C.
 
I guess I ll not be able to help ..sorry
 

Similar threads

Replies
53
Views
5K
Replies
26
Views
2K
  • · Replies 66 ·
3
Replies
66
Views
6K
  • · Replies 146 ·
5
Replies
146
Views
10K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
4K
Replies
13
Views
3K