How can I find direction with known 2 projection angles on xz and yz planes?

118215-vector3.jpg

I think ‘A’ vector3 direction would be
Quaternion.AngleAxis( A, transform.up) * transform.forward &
‘B’ vector3 direction would be
Quaternion.AngleAxis( -B, transform.right) * transform.forward

But I dont know the vector3 direction of ‘u’ Vector.
I need direction for Raycasting.
Can someone help with this. Thanx Cheers:)

The easiest way looks to be projecting the vector calculated from A onto the X axis and adding to the vector calculated for B (or the same technique the other way around)

Vector3 aVec = ...;
Vector3 bVec = ...;
Vector3.Project(aVec, transform.right)+bVec;

I find below code working for raycasting direction :slight_smile:

Vector3 u = new Vector3 (-Mathf.Tan (B * Mathf.Deg2Rad), Mathf.Tan (A * Mathf.Deg2Rad), 1);
u= Quaternion.Euler(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z) * u;

But anyways many thanx for considering my question to answer.