1
\$\begingroup\$

I'm trying to replicate the movement in this game: https://www.youtube.com/watch?v=OcvD8BXars8

The players ship along with all other game elements move along the surface of a mesh.

I've tried replicating this by ray-casting down on the mesh to have an idea of the up direction which is fairly straightforward, the problem is rotating the object on the axis of that normal such that the front is always facing the way the player intended (when the player is moving on the mesh the hit normal changes throwing everything off).

\$\endgroup\$

closed as unclear what you're asking by doppelgreener, Gnemlock, Josh Jun 8 '17 at 15:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Related: gamedev.stackexchange.com/questions/14328/3d-game-on-a-planet/… \$\endgroup\$ – Ryan Jul 2 '16 at 10:12
  • \$\begingroup\$ You can store the facing direction of the ship and when the hit normal changes because you moved to another polygon, calculate the new direction vector by finding the closest perpendicular vector of the new normal with the previous direction vector \$\endgroup\$ – ibrabeicker Jul 5 '16 at 19:04