Hey, serious math friends who know how to do a math good? I gotta do a thing with some vectors for a game, but the only solution that’s jumping to mind for the thing seems complicated and expensive and I want to make sure I’m not missing some really simple math thing that makes it as simple as it seems like it ought to be.
So, this is in 3D, but presumably the same principles should apply in 2D- let’s say you have a known vector u, and a variable vector v, and you want to get… the point that corresponds to where you’d end up if you followed v and then, treating the direction of v as the positive y axis, followed u. Like:
(the application here is that I want an object to move to a defined position and orientation relative to the camera.)
So, like, my immediate brute-force solution here is to compute the angle A of v relative to the y-axis, then compute a vector u’ that’s been rotated by A, and then add u’ to v to get my point. Except, that involves a bunch of trig calculations, which I would intuitively assume to be pretty expensive on the processor compared to adds or mults, and I’m going to be computing this position every frame.
So is there like, a name for this operation? And a faster way to calculate it than doing a bunch of trig?