• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Relative gravity on arbitrary objects

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1TheComet  Members

Posted 26 April 2014 - 05:08 AM

I'm not sure how many of you are familiar with the F-Zero series, if not, check out this video so you have an idea of what I'm talking about:

Note in the video how it's possible to drive all around the cylinder pipe without falling off.

I'm looking to implement something similar to their relative gravity mechanic, but I'm not entirely sure how I should approach it. How does F-Zero know what is "down"? Does it average the surrounding normals of the underlying mesh, and use that?

What happens when you're far away from any surfaces?

Edited by TheComet, 26 April 2014 - 05:09 AM.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

### #2ikarth  Members

Posted 26 April 2014 - 06:07 AM

I don't know how F-Zero does it, but there are several ways to implement this.

The easiest is just to define the position of the ship on a plane (that wraps from left to right) and then translate that to its position on the cylinder. It's like UV coordinates: your internal coordinate system has some predictable relationship with the world coordinate system, and when it's time to display it you just do the appropriate translation. I've done a game that explicitly uses the UV coordinates of the ground terrain to track where object are, so they don't have to care about the height map, though you can use any working coordinate system. Drawback of this method is that you can't have arbitrary positions in space as easily, so if your ship has the ability to leave the track you need another method. Doesn't matter as much in a racing game, obviously.

A more complex method that can reference arbitrary geometry is the one used by Super Mario Galaxy, as explained in this article on Gamasutra: http://www.gamasutra.com/view/feature/131997/games_demystified_super_mario_.php

Basically, gravity is redefined to be relative to the normals of nearby polygons.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.