Spherical Worlds

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
AlexL
Posts: 184
Joined: Tue Mar 02, 2004 6:06 pm
Location: Washington State

Spherical Worlds

Post by AlexL »

I've had the idea rolling over and over in my head now, for a game that takes place on spherical worlds. But I haven't quite been able to figure out how I should go about executing the idea, at first I thought about faking them, but as I got farther and farther along with my design documents I realized that this wouldn't work.
My next idea is to have a pivot point in the center of each 'world' and have the player being pulled in towards that point, so he doesn't fall into nothingness. But I'm not sure if this is a good way to do this, so what I'm asking is for some input on what to do here. If anyone knows of any links for reading up on spherical worlds, or a link if they've already been talked about here; I would be extreamly greatful, thanks for your time :)

Btw, the worlds would only be 2x to 3x the size of the player; quite small.
Guest

Post by Guest »

just use your sphere model or whatever, but when u use ur physics engine, make sure the planet has like a whole bunch of gravity or something.
AutoDMC
Posts: 104
Joined: Sat Sep 18, 2004 3:44 pm

Post by AutoDMC »

Just an idea, it might work. (Sorry if the picture stretches the board)
Image

I drew the picture with a physics engine in mind, but basically all you have to do is place your character in space, and put a sphere under it. Rotate the sphere according to the user's input, happiness.

If you want to use a physics engine, just drop your character onto a sphere with it's point of origin undernith the character, set upon the "gravity plane." Then roll the sphere around undernith the character.

:D Hav'nt tested it... just slapped it togeather.
Dingsi
Posts: 6
Joined: Thu Sep 30, 2004 8:17 pm
Location: Hannover, Germany
Contact:

Post by Dingsi »

What will happen with other moving objects (e.g. other players), AutoDMC? How do they move on the sphere in your modell? o.o
AutoDMC
Posts: 104
Joined: Sat Sep 18, 2004 3:44 pm

Post by AutoDMC »

Well, in my case, I made the assumption that there was going to be only 1 moving body (aka Sonic 3 bonus stages... the character moves, but everything else stays static to the world.)

If you want other things to move, you might be able to simply make the two bodies gravitationally attractive to each other (like what was already said), or you can translate the gravity plane to be perpindicular to every dynamic object as you do the physics engine part. I don't know how well that would work, though :D
AlexL
Posts: 184
Joined: Tue Mar 02, 2004 6:06 pm
Location: Washington State

Post by AlexL »

Thanks for the picture and explanation AutoDMC, it really helped out and is going to make it much easier then the idea that I had in mind :D
SARIN
Posts: 139
Joined: Fri Oct 29, 2004 3:53 am

Post by SARIN »

if i were u, i wouldnt rotate the world. these variables would have to be changed,
rotating the character to the world=1 vector
rotating the world=world vectors + any enemies, npcs, drops, and anything else like that
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

would this even require a physics engine??

seems to me you could use an algorithm of the spherical sort to fix the charactor a certain distance from the center point of your world.

Not sure how this would work but I am sure about one thing.

It's not going to be as easy as most things and it's going to require alot of PI and cheesecake.



...what I like cheesecake?!
mohaps
Posts: 248
Joined: Tue Jun 08, 2004 1:54 pm
Location: Shrewsbury MA
Contact:

Post by mohaps »

a simple solution for a rotation like effect on a planetary world.

Write a Planet Scene Node..

Add a terrain scene node...

depending on the players's position select grids from the terrain to show..

for example

0.0 0.1 0.2
1.0 1.1 1.2
2.0 2.1 2.2

PLayer in grid x,y means the grid becomes


x_.y_ x_.y x_.y+
x.y_ x.y x.y+
x+.y_ x+.y x+.y+

where

x_ = (x-1) % GRID_SIZE
y_ = (y-1) % GRID_SIZE
x+ = (x+1) % GRID_SIZE
y+ = (y+1) % GRID_SIZE



render and place objects accordingly...
---
Saurav Mohapatra
author, artist and bona fide geek

web: http://www.mohaps.com
email: mohaps AT gmail DOT com
SARIN
Posts: 139
Joined: Fri Oct 29, 2004 3:53 am

Post by SARIN »

hmm, u could also use upvectors. if ur using a physics engine, use the upvector joint (i no they have it in newton, not sure about others). however, this might cancel out some rotation;
to get the upvector, use something like the line2d getangle (for x and y, z for z use again for y and z or something) and convert it, maybe by %360 or something
Post Reply