Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

arm

3D Movement Problems

This topic is 5557 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites
quaternions provide a solution for gimbal lock. They let u rotate around an arbitrary axis, not just x,z, or y-axis

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!