3D circle movement
It's probably a simple math question, been awhile since I've done any kind of real trig though.
I want to create circular paths, basically. I achieve this on the xy axis by finding the position of a particle with radius * cos(x) and radius * sin(y). Well, actually, cos(y + 90), so I can use vcosf. That's fine and dandy. As is my yz, because they are opposite trig functions. However, xz just creates a straight line, since I'm using the same trig function. I'd just switch the trig function on Z, but then if I had x, y and z movement, the YZ wouldn't create a circle. Should I be using tangent(even though it's undefined at certain points), or is there another way around this?
I want to create circular paths, basically. I achieve this on the xy axis by finding the position of a particle with radius * cos(x) and radius * sin(y). Well, actually, cos(y + 90), so I can use vcosf. That's fine and dandy. As is my yz, because they are opposite trig functions. However, xz just creates a straight line, since I'm using the same trig function. I'd just switch the trig function on Z, but then if I had x, y and z movement, the YZ wouldn't create a circle. Should I be using tangent(even though it's undefined at certain points), or is there another way around this?
Could you clarify what exactly you are trying to accomplish.
Okay, say you have a circle with radius = 1.
If you want to traverse around the circle, you'd just set your positions up with trig functions and the angle you are on the circle. So x = cos(rotation), y = sin(rotation). That'd make a circle, so if you had some dot with positions at {cos®, sin®}, as you increase r, the dot moves in a circular direction... basically, circling the z axis.
When you add in a third dimension, if you use cos® to find z, you will create a circular movement around the x axis, if you use sin® to find z, you will create a circular movement around the y axis. Unfortunately, you can't do both. I'm asking what trig function I will need to put my angle through in order to obtain a z coordinate that makes the dot move in a sphere like pattern.
If you want to traverse around the circle, you'd just set your positions up with trig functions and the angle you are on the circle. So x = cos(rotation), y = sin(rotation). That'd make a circle, so if you had some dot with positions at {cos®, sin®}, as you increase r, the dot moves in a circular direction... basically, circling the z axis.
When you add in a third dimension, if you use cos® to find z, you will create a circular movement around the x axis, if you use sin® to find z, you will create a circular movement around the y axis. Unfortunately, you can't do both. I'm asking what trig function I will need to put my angle through in order to obtain a z coordinate that makes the dot move in a sphere like pattern.
"sphere like pattern"?
If you have created a point motion around a certain axis, you could apply a rotation matrix to the position of the point to change the axis of rotation.
Another way that would be easy to "cheat" if you want a nice orbit is to use the same movement laws as gravitation- if your particle has some velocity and is accelerating towards the center of the sphere, you will get an orbit. If you want it to be perfect you could make it so that the particle always lies on the sphere and the velocity is always of constant length.
Another way that would be easy to "cheat" if you want a nice orbit is to use the same movement laws as gravitation- if your particle has some velocity and is accelerating towards the center of the sphere, you will get an orbit. If you want it to be perfect you could make it so that the particle always lies on the sphere and the velocity is always of constant length.
Well theres about infinity sphere like patterns but heres a nice spirally one
Just try different things until you get one you like
0 < t < 1
[sin(2Ï€ t), cos(2Ï€ t), 2t-1]
Just try different things until you get one you like
0 < t < 1
[sin(2Ï€ t), cos(2Ï€ t), 2t-1]
Sir, e^iÏ€ + 1 = 0, hence God exists; reply!
I suspect this is what you'll want.
http://www.sacredsoftware.net/tutorials/...ions.xhtml
- Alex Diener
http://www.sacredsoftware.net/tutorials/...ions.xhtml
- Alex Diener
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
movement in full 3d | reubert | 13 | 4,304 |
Sep 19, 2004 08:55 AM Last Post: Mark Levin |