Re: Calculating new coordinates in 3D after moving an object



andreas wrote:

Good evening.

I have a question on how to calculate an objects coordinated after altering its position.

Example:

A triangle with coordinates;

P1 : -4, -4, 4 (x, y, z)
P2 : -3, -4, 4
P3 : -3, -4, 5

Let's say I want to rotate the line P2-P3 about 14 degrees around the axis P1-P2.

How can I find out the new coordinates of P3?

It would be a simple task using trigonometry if it it was only a 2D space, but 3D is puzzling me a little.
Someone hinted me that "Quaternion" would be the solution, but I tried to understand but didn't. Embarrassingly that area is a little over my understanding of mathematics.

Another question is if the object would be more complex, such as a Dodecahedron.

I assume I first must find the a central point around which the rotation should be done, but since all points are moving...
How can I find out the new coordinates of each and every one?

Any pointers to online resources or direct help are much appreciated.


3D-Rotation of any Vector (x,y,z) around an Axis of the Direction
(a,b,c) by an Angle @--And--Extract Axis and Angle out of a Rotation-
Matrix
http://insel.heim.at/mainau/331839/theart-Dateien/rotwithghost.pdf

The other way is with quaternions, which is worth studying. Both
methods have their numerical advantages and disadvantages at certain
angles.

With friendly greetings
Hero

.


Loading