Vector projection to other vector

  • Thread starter Thread starter twoski
  • Start date Start date
  • Tags Tags
    Projection Vector
AI Thread Summary
The discussion centers on projecting one vector (Vector A) onto another (Vector B) in a specified direction defined by a normal vector (Vector C) within a 3D space. The user is working in Unity and finds the built-in projection function inadequate for their needs, prompting them to seek a custom solution. Clarification is sought on the mathematical approach to achieve this projection, with some participants suggesting that projecting Vector A onto Vector B and then onto Vector C may be the correct method. The conversation emphasizes the utility of the vector dot product in performing these calculations, directing users to additional resources for understanding the mathematical principles involved.
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: 403
  • PQh2BdO.png
    PQh2BdO.png
    1.5 KB · Views: 778
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
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...

Similar threads

Back
Top