# Moving around a 3D Point

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

## Recommended Posts

i have an object that i want to move (translate) around a 3d point, so far i have something like this... where rot is the "rotation" from 0 to 360. is this right? Also, i want the object to rotate so that it is always facing away from the point. i suspect it will use sin and cos as well. x + (radius * (Math.cos(rot))) y + (radius * (Math.sin(rot))) z + (radius * (Math.cos(rot) + Math.sin(rot))) thanks in advance

##### Share on other sites
http://en.wikipedia.org/wiki/Spherical_coordinates

A=[0, pi]
B=[0, 2pi]

x = r * cos(B) * sin(A)
y = r * sin(B) * sin(A)
z = r * cos(A)

Also consider glRotate.

... and you'll have to figure out the rest from there.

awesome thanks!

1. 1
Rutin
41
2. 2
3. 3
4. 4
5. 5

• 16
• 18
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633362
• Total Posts
3011527
• ### Who's Online (See full list)

There are no registered users currently online

×