Velocity on the surface of a sphere

Click For Summary
SUMMARY

This discussion focuses on simulating the movement of an object along the surface of a sphere using spherical coordinates. The user seeks to implement a tether airplane simulator, requiring the calculation of position and velocity vectors. Key concepts include ensuring the velocity vector remains orthogonal to the position vector and maintaining constant speed across different latitudes. The provided code snippets illustrate the conversion from polar to OpenGL coordinates and the update mechanism for velocity.

PREREQUISITES
  • Spherical coordinates and their applications in 3D space
  • Vector mathematics, specifically orthogonal vectors
  • OpenGL for rendering 3D graphics
  • Basic physics principles related to motion on curved surfaces
NEXT STEPS
  • Implement a function to apply the velocity vector to the object's position while ensuring it remains on the sphere's surface
  • Research the use of quaternion rotations for smooth object movement on spherical surfaces
  • Explore the physics of circular motion and its application in tethered simulations
  • Learn about collision detection techniques for objects moving on curved surfaces
USEFUL FOR

Game developers, physics simulation engineers, and anyone interested in 3D graphics programming and motion dynamics on spherical surfaces.

phantom805
Messages
2
Reaction score
0
Hi,

I want to move an object along the surface of a sphere with a given velocity. I essentially want to make a simple tether airplane simulator (control line).

I know that I need to work in spherical coordinates for the position of the object and its velocity.

I have seen an old post that descibes a similar problem but I cannot get it to work and cannot fully get my head around it. https://www.physicsforums.com/showthread.php?t=295684

Any help would be much appreciated.

Thanks
 
Physics news on Phys.org
your object should have a vector for its velocity toward the center of the Earth an a manipulatable vector for it velocity tangent to the outside of the sphere. This will give the object a overall velocity "curved" around your sphere.
 
This is what I have so far. I initially get the position of the object. Theta and Phi are initially zero and Radius = 2; Therefore the polar to opengl result is (0,0,2);

void init()
{
//position from polar to opengl
pos.x = Radius * sin(theta) * sin(phi);
pos.y = Radius * cos(phi);
pos.z = Radius* cos(theta) * sin(phi);
}

The velocity must be orthogonal to the position vector.

void update()
{
//update velocity
velocity.x = speed*cos((heading));
velocity.y = speed*sin((heading));

//ensure velocity is orthogonal to position
float proj = (velocity.x * pos.x + velocity.y* pos.y + 0*pos.z)/(Radius*Radius);
velocity.x = velocity.x - proj * pos.x;
velocity.y = velocity.y - proj * pos.y;
}

How can I apply this velocity vector to my object to ensure that it remains on the sphere and the speed remains constant around the poles and equator?

Thanks
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
90K
  • · Replies 13 ·
Replies
13
Views
7K
  • · Replies 14 ·
Replies
14
Views
11K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K