Recent content by sumerian

  1. S

    Calculating Velocity on a Sphere

    I solved one problem. I did not re-use the new velocity and position vectors. It comes down to this: r=[x,y,z] R=sqrt(r.r) v=[vx,vy,vz] V=sqrt(v.v) a=distance/R loop( r1=cos(a)*r+sin(a)*R*(v/V) v=-sin(a)*V*(r/R)+cos(a)*v r=r1 ) Now the object moves smoothly along a great...
  2. S

    Calculating Velocity on a Sphere

    Hello, So I tried to work with the Gram-Schmidt process, to make my velocity vector orthogonal: var vx = speed*Math.cos(angle); var vy = speed*Math.sin(angle); var vz = 0; var proj = (vx*x + vy*y + vz*z)/(radius*radius); // (x*x + y*y + z*z); vx = vx - proj*x; vy = vy...
  3. S

    Calculating Velocity on a Sphere

    okay, I uploaded my project with the 2 different implementations: http://sumerian.50webs.com/test1.html" http://sumerian.50webs.com/test2.html" bpet's code has the same affect as confinement's code. It works but they slow down when approaching the "equator" (bpet) or the "poles"...
  4. S

    Calculating Velocity on a Sphere

    confinement, That was exactly what I was trying to implement. The object moves along the sphere's surface with the speed and angle I give it. But when it approaches the poles it seemes to slow down and on the "equator" it's very fast and unstable. I tried to tweak it a little bit, computers...
  5. S

    Calculating Velocity on a Sphere

    No, it's not that I want to give new spherical coordinates. I've written some pseudo-code about the concept. So I have a latitude and longitude and convert it to cartesian coordinates. Then I want to shift the xyz to a new place with the velocity vector (vx, vy, vz). It places my object on the...
  6. S

    Calculating Velocity on a Sphere

    Hello all, I am writing a program/game where you can move on a sphere's surface (like you are walking the earth). So I want to tell my object "move 10 meters in that direction", with a velocity-vector. The z-coordinate will never be used so I can construct this vector as: vx = speed *...
Back
Top