Rotation of a point about vectors

Click For Summary

Discussion Overview

The discussion revolves around the problem of rotating a point (billboardPosition) in 3D space so that its normal vector aligns with another point (cameraPosition). Participants explore methods for calculating the angle of rotation and the implications of such transformations.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes the need to rotate the billboardPosition's normal to point at cameraPosition and expresses uncertainty about the method to achieve this.
  • Another participant suggests using the dot product to find the angle between the vector from billboardPosition to cameraPosition and the billboard's normal, proposing a formula involving the cosine of the angle.
  • A different participant realizes that their initial approach was overly complicated and identifies a simpler problem: the rotation is constrained to the x-z plane, which complicates the calculations involving the y-coordinate of the camera.
  • One participant questions the clarity of the problem requirements, indicating that further details are needed to provide effective assistance.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the best method for achieving the desired rotation, and multiple competing views and approaches remain evident throughout the discussion.

Contextual Notes

There are limitations regarding the assumptions made about the rotation constraints and the need for clarity in the problem's requirements. The discussion also highlights the potential complexity of transformations in 3D space.

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):
[tex]x \cdot y = |x| |y| cos \theta[/tex] where theta is the angle between x and y so
[tex]cos^{-1} (\frac{x \cdot y}{|x| |y|}) = \theta[/tex]
So you can rotate the normal by the angle [tex]cos^{-1} (\frac{(c - b) \cdot n}{|c - b| |n|})[/tex]
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K