Followers 0

# Relative gravity on arbitrary objects

## 1 post in this topic

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
0

##### Share on other sites

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.

0

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account