Author Topic: Worm holes (having trouble with math)  (Read 7223 times)

0 Members and 1 Guest are viewing this topic.

Offline Aardwolf

  • 211
  • Posts: 16,384
Worm holes (having trouble with math)
For a game I'm starting work on, I want to have a 'realistic' worm hole effect.

The way I plan to simulate the worm hole is to have our 3d space be the surface of a 4d object.

Diagram:


There are two parts to this problem I have to worry about so far: the space transform and the object transform.

The space tranform:
I need to figure out what the worm hole looks like from the outside. I know it will appear as a spherical region of distorted space, but I need to figure out how the coordinates of things in normal space map to the image seen through/in the worm hole. That is, I need to be able to take points from the viewing side, the far side, and the inside of the worm hole, and figure out where they show up in camera-space.

The object transform:
I need to figure out how objects move and how their different points/faces show up in the space-transformed location and orientation.

The geometry I have considered using:
2d terms are used instead of the 3d analogs to help describe things more easily.

  • A circular curve from normal space into the worm hole, followed by a cylindrical tube, then opening with a circular curve back to normal space on the other side of the worm hole.
  • A curve of the form w = (d * r +/- sqrt(d^2 * r^2 + 4 * r * k)) / (2 * r) r = k / w + k / (d - w), where w is the distance along the through-the-worm-hole-axis, r is the distance of the point on the 3d surface from that axis, k is a positive constant, and d is the length of the worm hole

One problem I have foreseen with the first shape is that it would not allow multiple worm holes to overlap.
« Last Edit: May 07, 2008, 12:26:09 am by Aardwolf »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Worm holes (having trouble with math)
Just give up and make something pretty. You won't understand the math without years of study, and you'll probably get something wrong if you try to follow a populist approximation.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
I'm not going for true-to-physics realism, I'm just trying to get the general idea---that space is curved in a funnel-like shape and out another funnel to the other side.

 

Offline S-99

  • MC Hammer
  • 210
  • A one hit wonder, you still want to touch this.
Re: Worm holes (having trouble with math)
It'd really suck if it went from a gigantic funnel at one end to a 1inch diameter funnel at the other end.
Every pilot's goal is to rise up in the ranks and go beyond their purpose to a place of command on a very big ship. Like the colossus; to baseball bat everyone.

SMBFD

I won't use google for you.

An0n sucks my Jesus ring.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
Um... what?

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Worm holes (having trouble with math)
i wonder if i can script a porthole engine for freespace :D
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
I doubt it.

Does anyone know how to do this sort of math?

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Worm holes (having trouble with math)
i don't think its ever been done before, not in a game.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline zonination

  • 25
  • Ruining your HLP experience since 2008!
    • Skype
    • Steam
    • Twitter
    • reddit I guess?
Re: Worm holes (having trouble with math)
Well, I've studied 3d space in multivariable calc (and a lot of 3d graphing in my down time in high school), and I also know some theoretical physics, so I might be able to help.

The surface you're looking for is probably hyperboloidal. I'm pretty sure the vortex could take that shape, but I'm not sure how the edges would connect to the plane of normal space.

Try this equation:
X^2 + y^2 - r^2 = z^2
Let 'r' be a constant of your choosing; r determines the radius of the throat.

Here's an image:


Any more equations, just drop me a PM
« Last Edit: May 07, 2008, 01:26:01 am by zonination »
Subspace:
It's not a Shivan juggernaut.
It's a series of tubes.

Freespace is better than nothing.
Nothing is better than God.
Therefore, Freespace is better than God.

 

Offline Jeff Vader

  • The Back of the Hero!
  • 212
  • Bwahaha
Re: Worm holes (having trouble with math)
Does anyone know how to do this sort of math?
Herra Tohtori, if anyone. But why must you make things the hard way? What spectacular things are you trying to achieve? A purdy vortex/tunnel/something would be quite enough.
23:40 < achillion > EveningTea: ass
23:40 < achillion > wait no
23:40 < achillion > evilbagel: ass
23:40 < EveningTea > ?
23:40 < achillion > 2-letter tab complete failure

14:08 < achillion > there's too much talk of butts and dongs in here
14:08 < achillion > the level of discourse has really plummeted
14:08 < achillion > Let's talk about politics instead
14:08 <@The_E > butts and dongs are part of #hard-light's brand now
14:08 <@The_E > well
14:08 <@The_E > EvilBagel's brand, at least

01:06 < T-Rog > welp
01:07 < T-Rog > I've got to take some very strong antibiotics
01:07 < achillion > penis infection?
01:08 < T-Rog > Chlamydia
01:08 < achillion > O.o
01:09 < achillion > well
01:09 < achillion > I guess that happens
01:09 < T-Rog > at least it's curable
01:09 < achillion > yeah
01:10 < T-Rog > I take it you weren't actually expecting it to be a penis infection
01:10 < achillion > I was not

14:04 < achillion > Sometimes the way to simplify is to just have a habit and not think about it too much
14:05 < achillion > until stuff explodes
14:05 < achillion > then you start thinking about it

22:16 < T-Rog > I don't know how my gf would feel about Jewish conspiracy porn

15:41 <-INFO > EveningTea [[email protected]] has joined #hard-light
15:47 < EvilBagel> butt
15:51 < Achillion> yes
15:53 <-INFO > EveningTea [[email protected]] has quit [Quit: http://www.mibbit.com ajax IRC Client]

18:53 < Achillion> Dicks are fun

21:41 < MatthTheGeek> you can't spell assassin without two asses

20:05 < sigtau> i'm mining titcoins from now on

00:31 < oldlaptop> Drunken antisocial educated freezing hicks with good Internet == Finland stereotype

11:46 <-INFO > Kobrar [[email protected]] has joined #hard-light
11:50 < achtung> Surely you've heard of DVDA
11:50 < achtung> Double Vaginal Double ANal
11:51 < Kobrar> ...
11:51 <-INFO > Kobrar [[email protected]] has left #hard-light []

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
I was thinking more along the lines of:

Suppose x4 is the position in the fourth dimension of a point in space.

Let r = a + k/x4 + k(d-x4)

Then |<x1, x2, x3>| = r

Reversing this formula, we get:



That plus or minus sign means that it is symmetrical across the half-way space of the worm hole.

 

Offline zonination

  • 25
  • Ruining your HLP experience since 2008!
    • Skype
    • Steam
    • Twitter
    • reddit I guess?
Re: Worm holes (having trouble with math)
I was thinking more along the lines of:

Suppose x4 is the position in the fourth dimension of a point in space.

Let r = a + k/x4 + k(d-x4)

Then |<x1, x2, x3>| = r

Reversing this formula, we get:



That plus or minus sign means that it is symmetrical across the half-way space of the worm hole.

Meh, I'm more of a 3d person myself. As soon as I get a lot of spare time and a load of graph paper, I'll mess around with 4d, but until then, I can only provide equations that I can build.

Sorry, dude. :/
Subspace:
It's not a Shivan juggernaut.
It's a series of tubes.

Freespace is better than nothing.
Nothing is better than God.
Therefore, Freespace is better than God.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
You don't need a lot of graph paper, you just need an imagination and the ability to extrapolate.

For example, I once made a game where you fly around on the surface of a sphere. I could extrapolate and say that there is a ship in a 3d surface-space whose distance from some point in 4d is fixed--- that is, it lies on a hypersphere. Then I could fly around in any direction and come back to where I started. Of course, I would also be able to see the opposite side of my ship in any direction. This idea, though greatly changed since then, was inspired in part by that concept.

Edit:

It's looking less likely that a 'precise' version of this effect will be doable, but I'm considering faking it using render-to-texture and some well-picked texture coordinates.
« Last Edit: May 07, 2008, 02:02:52 am by Aardwolf »

 

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
Re: Worm holes (having trouble with math)
Uh... this is obviously way beyond me...

but isn't the fourth demension time?

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
This is not a physics concept! It is a geometry concept. Do not apply physics to it!

Edit: That came out wrong.

What I mean is, the geometric principles come in before other physical things. In this case, I am creating an arbitrary spacial dimension, and thus I add a 4th component to all vectors (and if need be, a fourth row and column to rotation matrices).

 

Offline Jeff Vader

  • The Back of the Hero!
  • 212
  • Bwahaha
Re: Worm holes (having trouble with math)
Uh... this is obviously way beyond me...

but isn't the fourth demension time?
It is actually a matter of what you want to agree on. Some people say it is the fourth. Another common way is to call time the 0th dimension. But this is indeed geometry. Do check out the Wikipedia article on the fourth dimension. There is a pretty animation as well.
23:40 < achillion > EveningTea: ass
23:40 < achillion > wait no
23:40 < achillion > evilbagel: ass
23:40 < EveningTea > ?
23:40 < achillion > 2-letter tab complete failure

14:08 < achillion > there's too much talk of butts and dongs in here
14:08 < achillion > the level of discourse has really plummeted
14:08 < achillion > Let's talk about politics instead
14:08 <@The_E > butts and dongs are part of #hard-light's brand now
14:08 <@The_E > well
14:08 <@The_E > EvilBagel's brand, at least

01:06 < T-Rog > welp
01:07 < T-Rog > I've got to take some very strong antibiotics
01:07 < achillion > penis infection?
01:08 < T-Rog > Chlamydia
01:08 < achillion > O.o
01:09 < achillion > well
01:09 < achillion > I guess that happens
01:09 < T-Rog > at least it's curable
01:09 < achillion > yeah
01:10 < T-Rog > I take it you weren't actually expecting it to be a penis infection
01:10 < achillion > I was not

14:04 < achillion > Sometimes the way to simplify is to just have a habit and not think about it too much
14:05 < achillion > until stuff explodes
14:05 < achillion > then you start thinking about it

22:16 < T-Rog > I don't know how my gf would feel about Jewish conspiracy porn

15:41 <-INFO > EveningTea [[email protected]] has joined #hard-light
15:47 < EvilBagel> butt
15:51 < Achillion> yes
15:53 <-INFO > EveningTea [[email protected]] has quit [Quit: http://www.mibbit.com ajax IRC Client]

18:53 < Achillion> Dicks are fun

21:41 < MatthTheGeek> you can't spell assassin without two asses

20:05 < sigtau> i'm mining titcoins from now on

00:31 < oldlaptop> Drunken antisocial educated freezing hicks with good Internet == Finland stereotype

11:46 <-INFO > Kobrar [[email protected]] has joined #hard-light
11:50 < achtung> Surely you've heard of DVDA
11:50 < achtung> Double Vaginal Double ANal
11:51 < Kobrar> ...
11:51 <-INFO > Kobrar [[email protected]] has left #hard-light []

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Worm holes (having trouble with math)
What sort of game is this supposed to be? If I'm understanding you right, the math here is fairly simple but I can't think of any reason you would need to use a 4D formulation of space in a game.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
It's planned as a space flier/shooter (although you may be able to get command over a capital ship too). The 4D effect is so that we can do a 'realistic' (that is, both cool-looking and justifiable) FTL effect.

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Worm holes (having trouble with math)
It would be more efficient to just do all the calculations in 3D and use portals/warp zones to simulate the effect, which is how these kinds of effects are done in most graphics engines. Putting things in 4D doesn't make much sense for something that is actually intended to be rendered.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Worm holes (having trouble with math)
I'm considering doing render-to-texture instead, and choosing texture coordinates to make the effect look reasonably like it would look if we were to do the 4D calculations.