3D Movement Problems

Started by
4 comments, last by arm 20 years, 9 months ago
This is probably such a novice question.....but, I have a point in 3D space (x,y,z) and i wish to be able to move the point based on a direction given by an angle or angles. My questions are as follows: 1. How many angles are needed to allow complete freedom of movement in the 3D space. 2. What are the calculations to do this? I can do this in 2D space easily. All you need is a point (x,y) and just one angle. The calculations are x = magnitude * sin(x) and y = magnitude * cos(y). When I add a z axis and an extra angle the problems begin.
Advertisement
In the last term , we saw the spherical coordiate system and cylindirical coordinate system.Maybe they can help you :

Cylindirical C.S :
x = r * cos Q where Q is the angle between r and x axis.
y = r * sin Q
z = z

Spherical C.S :
x = q * sin x * cos Q where Q is the angle between q and x axis
y = q * sin x * sin Q where x is the angle between q and z axis
z = q * cos x

(these systems are alternative to the rectangular coordinate system to reduce the calculation time while finding the volume,area,Mass etc.)

Or other way think the 3D axis in three components.Say xy,xz,yz.
For example the point in space(x,y,z) goes from (1,2,3) to (50,20,30).
So
(1,2) to (50,20) in xy
(2,3) to (20,30) in yz
(1,3) to (50,30) in xz

As you see last is so convenient and not complex
Ýstanbul-Türkiye
Cheers Xelon

The Spherical C.S thingy is what I was after although the last method you said would indeed be much faster, so i''ll give that a try as well.
If you try the last method, you''ll have to mess around with the Gimbal lock problem. If you have orientation problems with that system, google "gimbal lock."
You know what I never noticed before?
quaternions provide a solution for gimbal lock. They let u rotate around an arbitrary axis, not just x,z, or y-axis
To quote Chris Hecker:
"It''s possible to prove that no three-scalar parameterization of 3D orientation exists that doesn''t suck, for some suitably mathematically rigorous definition of ''suck''"

http://www.d6.com/users/checker/pdfs/gdmphys4.pdf

Spherical coord''s (SC''s) can handle 2 DOF, but don''t give you all 3. Picture a plane (the flying kind). SC''s can make the plane do a nose dive, or pull up. They can also make the plane change direction, say, instead of going to New York, turn and go to Florida. But, they can''t handle the plane tipping its wings, along with the other 2.

This topic is closed to new replies.

Advertisement