|
-
May 1st, 2001, 06:36 PM
#1
Thread Starter
Addicted Member
How do I generate 2 vectors that are paralell to 1?
Okay, I need to generate 2 vectors that are perpendicular to each other and one that is already given ie. a normal. I've given it some thought and this is what I came up with: Let's say you have 3 vectors that are perpendicular to each other, a=<1,0,0>, b=<0,1,0>, c=<0,0,1>. Now all you have to do is rotate a to were it equals the normal in question, and rotate b and c to keep them perpendicular. So it all basicaly boils down to this: Find x, y, and z angles and rotate a by that angle so that it faces the same direction as the normal. Also, will someone care to explain 3D rotation using matices to me ?
Last edited by Cuallito; May 1st, 2001 at 07:56 PM.
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
May 1st, 2001, 07:47 PM
#2
Frenzied Member
I think you mean perpendicular, not parallel.
Matrices aren't my strong point, so I'll leave it to someone else.
Harry.
"From one thing, know ten thousand things."
-
May 1st, 2001, 08:14 PM
#3
transcendental analytic
A vector is perpendicular to a plane, in which all vectors are parallell. You can use the cross product for any direction. 3d rotation is quite simple if you have a 4x4 or 3x3 matrix. You have an amount of transformation matrices which you multiply with an absolute matrix to give a rotated transformation. i have some links for you:
http://www.geocities.com/siliconvall.../matrices.html
http://www.eng.iastate.edu/me516/not...ec20/index.htm
http://www.manning.com/Lussier/Chapter3.html
http://www.geocities.com/siliconvall...6/cam_matr.txt
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2001, 08:37 PM
#4
Thread Starter
Addicted Member
Ill make myslef more clear....
All I need to do is find the 2 vectors that are perpendicular to vector n.
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
May 1st, 2001, 08:39 PM
#5
transcendental analytic
you have to be more specific than that, or pick a random vector as a partner for the crossproduct.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2001, 09:21 PM
#6
Thread Starter
Addicted Member
ok
I mean ALL 3 VECTORS have to be perpendicular to each other.
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
May 1st, 2001, 09:25 PM
#7
transcendental analytic
the vectorproduct of them should give you the third vector, all perpendicular to each other.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 2nd, 2001, 11:48 AM
#8
Lively Member
current vector: u
For your second vector choose any vector that is not parallel to u.
This vector will constist of two parts. One parallel to u and one perpendicular to u.
second vector: v = v1 + v2
where v1 is the parallel component and v2 is the perpendicular component.
The parallel component can be found using the following equation (note a period "." will indicate the use of the dot product)
v1 = [(v.u)/(u.u)] * u
You can then find the perpendiculat vector
v2 = v - v1
The third vector can be found using the cross product between u and v2.
w = u x v2
you now have three perpendicual vectors u, v2 and w. For a useful basis simply unitize the vectors (set the length to 1).
Unit u = u / sqrt(u.u)
-
May 2nd, 2001, 11:56 AM
#9
transcendental analytic
that's another solution, and yeah i forgot to mention the picked vector should not be parallell to the original
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|