To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 2988
2987  |  2989
Subject: 
Re: 3D geometry question
Newsgroups: 
lugnet.cad
Date: 
Wed, 13 Oct 1999 12:54:41 GMT
Viewed: 
851 times
  
Fredrik Glöckner:

Say I have a vector v with length normalized to 1.  For
simplicity, picture this vector as starting in the origin.

Vectors don't start anywhere. A vector is just a direction
and a length.

Now, I need a rotation matrix M with the following
properties:

o If I rotate a part with one edge going from (0,0,0) to
  (0,-1,0) (i.e., pointing upwards), this edge should
  coincide with the vector v after the transformation

Lets call the vector along the edge e.

o M should be a proper transformation, i.e., no scaling or
  shearing.

There are infinitely many solutions to the problem. When you
have one solution, any rotation around v is also a solution.
We have to solve

v = M e

with respect to M, with the additional constraint

det(M) = 1

Hmmm? 9 variables and 4 equations. - That can't be sufficient
constraints to ensure M is a rotation matrix.

Lets try something else...

Any direction in three-dimensional space can be constructed
by one rotation around the x axis followed one rotation
around the y axis:

     / 1    0      0    \ /  cos(b) 0 sin(b) \
M = | 0  cos(a) sin(a) | |    0    1   0    |
     \ 0 -sin(a) cos(a) / \ -sin(b) 0 cos(b) /
     /    cos(b)        0    sin(b)       \
   = | -sin(a)sin(b)  cos(a) sin(a)cos(b) |
     \ -cos(a)sin(b) -sin(a) cos(a)cos(b) /

Now you have a rotation matrix parametrised by
the two rotation angles (a and b). The equation

v = M * e

can then be rewritten as three equations:

v1 =         cos(b) e1 +                    sin(b) e3
v2 = -sin(a) sin(b) e1 + cos(a) e2 + sin(a) cos(b) e3
v3 = -cos(a) sin(b) e1 - sin(a) e2 + cos(a) cos(b) e3

(which it should be possible to solve)

Play well,

Jacob

    ---------------------------------------------------
    --  E-mail:          sparre@cats.nbi.dk          --
    --  Web...:  <URL:http://hugin.ldraw.org/LEGO/>  --
    ---------------------------------------------------



Message has 1 Reply:
  Re: 3D geometry question
 
(...) Sure. But to picture the vector as starting in the origin makes it easier to understand what I want in the paragraph below: (...) In fact, for my application, any of these solutions would suffice. (...) I think we also need some constraints on (...) (25 years ago, 13-Oct-99, to lugnet.cad)

Message is in Reply To:
  3D geometry question
 
Hi, I have this problem I hope someone may solve. Say I have a vector v with length normalized to 1. For simplicity, picture this vector as starting in the origin. Now, I need a rotation matrix M with the following properties: o If I rotate a part (...) (25 years ago, 13-Oct-99, to lugnet.cad)

7 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR