Rotation of a point about vectors

AI Thread Summary
To rotate the billboardPosition so its normal points at cameraPosition, the vector from billboardPosition to cameraPosition can be calculated as c - b. The angle between this vector and the billboard's normal can be found using the dot product formula, leading to the calculation of the angle θ. However, the user realizes their approach is limited to rotation around the y-axis, which does not account for the camera's y-coordinate. They seek a method to restrict calculations to only the x and z coordinates of both points. Clarification on the program's specific needs is also requested to determine the best approach.
Bucky
Messages
79
Reaction score
0
I have two points in 3d space, cameraPosition and billboardPosition. In addition to this i have their normals.

I want billboardPosition to be rotated so that its normal points at cameraPosition.

basically...I'm stuck.

I've found the equation of the vector that passes through both points using equation (18) on http://mathworld.wolfram.com/Line.html" (its the correct one to use yeah?).

So how do i go about finding the angle between billboardNormal and the line i found? also is this the easiest way to go about matters or is there a faster/easier method?
 
Last edited by a moderator:
Mathematics news on Phys.org
For conciseness you have c and b (cameraPosition and billboardPosition). You also have n, the normal to the billboard. The vector from b to c is c - b. You can find the angle between c - b and n by using the dot product (this is how an angle can be defined in 3 dimensions):
x \cdot y = |x| |y| cos \theta where theta is the angle between x and y so
cos^{-1} (\frac{x \cdot y}{|x| |y|}) = \theta
So you can rotate the normal by the angle cos^{-1} (\frac{(c - b) \cdot n}{|c - b| |n|})
The dot there is the dot product, and the || signs mean the length of the vectors, calculated by (x^2 + y^2 + z^2)^(0.5) if the vector is (x, y, z).

I don't know that rotation is exactly what you want though. Do you want other stuff to move with this vector when you rotate it? In that case you should express the rotation as a linear transformation with b at the origin.
 
ok i had written out a long step by step of what I am doing but I've realized my problem is much simpler than what i thought it was.

i think my problem is I am only rotateing it about the y-axis (its "fixed" to only change in the x-z plane) but its calculations take into account the y-position of the camera...not good.

is there another method i can use to only use the x and z coordinates for the camera and billboard?
 
You have not made clear just what it is that your program needs to do.
 
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top