Hard Light Productions Forums

Off-Topic Discussion => General Discussion => Topic started by: Aardwolf on May 07, 2008, 12:21:17 am

Title: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 12:21:17 am
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:
(http://i93.photobucket.com/albums/l77/Aardwolf001/Quick%20Illustrations/wormhole2.jpg)

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.


One problem I have foreseen with the first shape is that it would not allow multiple worm holes to overlap.
Title: Re: Worm holes (having trouble with math)
Post by: General Battuta on May 07, 2008, 12:24:23 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 12:27:40 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: S-99 on May 07, 2008, 01:01:57 am
It'd really suck if it went from a gigantic funnel at one end to a 1inch diameter funnel at the other end.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 01:05:12 am
Um... what?
Title: Re: Worm holes (having trouble with math)
Post by: Nuke on May 07, 2008, 01:06:00 am
i wonder if i can script a porthole engine for freespace :D
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 01:08:06 am
I doubt it.

Does anyone know how to do this sort of math?
Title: Re: Worm holes (having trouble with math)
Post by: Nuke on May 07, 2008, 01:15:09 am
i don't think its ever been done before, not in a game.
Title: Re: Worm holes (having trouble with math)
Post by: zonination on May 07, 2008, 01:16:15 am
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:
(http://img509.imageshack.us/img509/1964/hyperboloidrw9.th.png) (http://img509.imageshack.us/my.php?image=hyperboloidrw9.png)

Any more equations, just drop me a PM
Title: Re: Worm holes (having trouble with math)
Post by: Jeff Vader on May 07, 2008, 01:16:15 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 01:31:27 am
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:

(http://www.game-warden.com/masterpokey/CarrierAssault/x4equalsquadratic.png)

That plus or minus sign means that it is symmetrical across the half-way space of the worm hole.
Title: Re: Worm holes (having trouble with math)
Post by: zonination on May 07, 2008, 01:39:54 am
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:

(http://www.game-warden.com/masterpokey/CarrierAssault/x4equalsquadratic.png)

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. :/
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 01:56:08 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: Mars on May 07, 2008, 02:00:52 am
Uh... this is obviously way beyond me...

but isn't the fourth demension time?
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 02:04:21 am
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).
Title: Re: Worm holes (having trouble with math)
Post by: Jeff Vader on May 07, 2008, 02:12:42 am
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 (http://en.wikipedia.org/wiki/Fourth_dimension). There is a pretty animation as well.
Title: Re: Worm holes (having trouble with math)
Post by: CP5670 on May 07, 2008, 02:15:28 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 02:20:14 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: CP5670 on May 07, 2008, 02:24:42 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 02:26:05 am
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.
Title: Re: Worm holes (having trouble with math)
Post by: WMCoolmon on May 07, 2008, 02:41:40 am
A good 4D game would be unusual. Might even be a publicity point.
Title: Re: Worm holes (having trouble with math)
Post by: CP5670 on May 07, 2008, 02:58:28 am
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.

You should find out how to use portals. I think those should do exactly what you want. I'm not that familiar with computer graphics but there are several game engines that support them. I used to make stuff like this in Descent 2, where it was easy to trick the cube-based graphics engine into rendering "impossible" levels that can't exist in 3D space, and I have seen maps in newer games with similar effects.

Making the whole playing area into some sort of messy 4-manifold would be pointless, as it would be more computationally expensive and there would be no difference in anything from the player's point of view.
Title: Re: Worm holes (having trouble with math)
Post by: watsisname on May 07, 2008, 05:03:56 am
LOLWUT, a intelligent discussion on extra-dimensional maths on HLP?
Title: Re: Worm holes (having trouble with math)
Post by: S-99 on May 07, 2008, 06:17:50 am
Yeah and what about my question?
Title: Re: Worm holes (having trouble with math)
Post by: General Battuta on May 07, 2008, 11:07:13 am
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.

Actually, Rian's probably better-qualified when it comes to the math of general relativity, being an MIT physics student and all. I doubt that wormhole crap is something either of them could do, however.

Anyway, aardwolf, what advantage does this whole fourth-dimensional-rendering thing have over a regular old FS2 subspace vortex? Does it show gravitational lensing? That's what you'd see around a real wormhole...I think Lobo's right. Just go for a pretty vortex thing.

Title: Re: Worm holes (having trouble with math)
Post by: CP5670 on May 07, 2008, 11:32:20 am
Quote
Anyway, aardwolf, what advantage does this whole fourth-dimensional-rendering thing have over a regular old FS2 subspace vortex?

It has none in a computer graphics context. That's what I'm trying to tell him. :p

GR theory or Riemannian geometry is irrelevant here since it's not necessary or appropriate for what he is trying to do.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 12:25:39 pm
In normal space, it would look the same as always, but when the space gets sufficiently distorted (at a worm hole), the view would be considerably different. Note that in <x,y,z,w> space, at a worm hole, there is a spherical cylinder (that is, a sphere in <x,y,z> space, which extends to all values of w) that simply does not exist - there is no point in space that occupies the region in the center of the worm hole.

However, looking at it from the outside, I believe that the a ray to the center of the worm hole would come out on the same side it entered on the far side of the worm hole. I have also been able to determine that, looking along the plane formed by the two axes that are not the through-the-worm-hole axis, every direction you would see the far side of yourself (provided there is light to illuminate it, etc.).

And once again, to reiterate, I am doing this all in a geometry context, not in a physics context. I don't care about gravity or relativity, just that the rays are the correct geodesics of the 3d surface of the 4d object.
Title: Re: Worm holes (having trouble with math)
Post by: watsisname on May 07, 2008, 03:07:19 pm
I'm no expert on this sort of math or physics, but wouldn't the curvature of space around the opening of a wormhole would be similar to the curvature of space around any massive spherical object?  In fact, wouldn't this region at any distance above the "horizon" of a wormhole be indistinguishable from that around an ordinary blackhole?

If that's the case then I recall that radial distances from the center would be stretched.  The greater the gravitational field (curvature of 4D space), the greater this effect.  This is even apparent for the Earth:  The radius of the Earth is not exactly the same as half the diameter.
I'm not sure how helpful that is but maybe it's something to think about if you're trying to get an accurate portrayal of the distortion effect around these things.
Title: Re: Worm holes (having trouble with math)
Post by: General Battuta on May 07, 2008, 03:28:12 pm
In normal space, it would look the same as always, but when the space gets sufficiently distorted (at a worm hole), the view would be considerably different. Note that in <x,y,z,w> space, at a worm hole, there is a spherical cylinder (that is, a sphere in <x,y,z> space, which extends to all values of w) that simply does not exist - there is no point in space that occupies the region in the center of the worm hole.
odesics of the 3d surface of the 4d object.

You mean to say there's a spherical cylinder that doesn't exist in your geometrical approximation of a real wormhole.

You can't understand the situation without doing the actual math. There's no sense in doing it with plain geometry because geometry is sadly inadequate. That's why wormholes can't be described by Euclidean geometry, and why a whole new field of physics was invented to explore them.

I admire what you're trying to do, but isn't it rather like beating your head on a wall?
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 07, 2008, 03:41:45 pm
No-one expects the Physics inquisition!

Here, I don't understand what effect are you looking for, if it is not supposed to look like a wormhole in general relativity - according to current understanding (and actually my understanding of the issue), this may only happen when two black holes collide. In a real wormhole, being inside black holes, in forwards direction it is assumed that observer cannot see anything (since all photon paths are going towards the center like observer himself), while if facing backwards, observer sees the scenery what he just occupied before crossing the Schwarzschild radius since now photons can enter his eye while travelling towards the center. For the observer outside, it appears that the person never crossed the Schwarzschild radius, all that he can see is a red-shifting image of the person that fell in.

Now that being said, if this warping has nothing to do with physics, is it elongation or non-linear compression that you would like to see? The good thing with these is that you don't actually need four dimensions to represent them, three is enough. If it is an enhancement to the Freespace's two-dimensional warp-animation, then hyperbola could be a good initial guess. Would you like the warping ship to deform according to the distance it is from the hole's mouth?

Mika
Title: Re: Worm holes (having trouble with math)
Post by: watsisname on May 07, 2008, 04:00:26 pm
Quote
I believe that the a ray to the center of the worm hole would come out on the same side it entered on the far side of the worm hole.

Are you saying that the direction of motion at entry is the same as at the exit?  If so then I believe you're correct on this.  An object entering when moving in the +x direction will exit moving in the +x direction, which would look pretty interesting if +x at the exit happened to point back to the opening it entered from.  Here's a picture to show what I mean:

(http://img206.imageshack.us/img206/7332/lolportalsvm1.jpg)
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 04:20:16 pm
Actually that is backwards from what I believe would happen. Follow the rays in the diagram in the original post to see what I mean.

And by there being a spherical cylinder that doesn't exist, also consult said diagram, and note that there is no point on the surface that exists directly above or below the narrowest circle of the worm hole. There is an empty column of 4d space.

As for the effect I'm trying to pull off, I want it so that the color at the pixel is (or very nearly is) the color of the ray that goes from your eye outward through that pixel on the near plane of the frustum, is bent by the distortion of the space, and eventually hits something (or the skybox) in, on the viewing side, or on the far side of the worm hole.

I have done some analysis (drawing stuff) of the problem, and I will copy them below shortly. have posted some copies of the drawings:

(http://www.game-warden.com/masterpokey/CarrierAssault/WHTopView1.png)
(http://www.game-warden.com/masterpokey/CarrierAssault/WHIsoPNG.png)
Title: Re: Worm holes (having trouble with math)
Post by: Dark Hunter on May 07, 2008, 05:07:31 pm
I do believe this is the most awesome discussion I've ever seen on these boards. :)

I'd help if I could, but unfortunately I've not done any 4d geometry yet.
Title: Re: Worm holes (having trouble with math)
Post by: Nuke on May 07, 2008, 05:39:51 pm
the closest i came was when i tried to do quaternions. it only sorta worked, but i had a bunch of different kinds of gimbal lock, and i accidently rendered the scene to a plane which was mysteriously rotating in space. sorta like the end of superman.
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 05:43:51 pm
One annoying thing about 4D math is that the vector product is a ternary operator; that is, it takes 3 argument vectors.

(http://i93.photobucket.com/albums/l77/Aardwolf001/Equations/4vectProduct.png)

Edit:
Actually, this formula is something I extrapolated myself. I've never done a full proof or analysis, and have luckily never had to use the damn thing.
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 07, 2008, 05:49:53 pm
Ah, I think I got it. It is gravitational lensing, but instead of using a spherical source, you would like to use a cylindrical source. About your questions of possible ray paths, I unfortunately cannot answer them since I don't know which laws of Physics are thought to apply and which are ignored. But since it's your game, you can pretty much describe a phenomenological model for that cylinder, which can do pretty much you want it to do.

In the real world I think it is possible that the photon striking infinitesimally (dr) further than the Schwarzschild radius in the direction of the local tangent at the edge of the black hole, you could get the photon circle the black hole by certain amount of time with differing orbits (is it an epicycle?). At the limit when dr approaches Schwarzschild radius, the photon would circle event horizon forever, though the probability of this happening would according to my understanding, approach zero. Now, a little bit over that and it is doomed to go to singularity.

One of the interesting related things could be the found from gradient index lens:
http://en.wikipedia.org/wiki/GRIN_lens

Also, the way I would do that effect would be to use, for example, the law of gravity to model a particle with very small mass (and sufficient velocity) and solve the equation of motion for that in xy-plane. Since this is computationally extremely heavy operation, I would recommend calculating trajectories for several "photons" only in the development phase, and then using those trajectory initial conditions as look up tables and then linearly approximating values between them.

Mika
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 07, 2008, 06:03:06 pm
Yes, I will most likely approximate the effect using a render-to-texture and some fancily pre-calculated and interpolated/transformed texture coordinates.

Oh, and Edit:

Here's another way to think of the setup. Add a fourth dimension. Each point in 3d space gets a coordinate in this fourth dimension. The speed of the ray is constant. Assume, for simplicity, that it is 1. Assume for simplicity also that the ray has mass 1 (so that force = acceleration). There is a force perpendicular to the surface (that is, a scalar multiple of the 3-vector product of the 3d axes), with magnitude equal to the curvature of the curve parallel to the velocity at that point, taken at that point.

2nd edit:
(and thus the ray maintains constant speed and remains on the surface of the 4d object.)

3rd edit:
This diagram is labeled. Read the labels. I'm not sure about the direction of the bending of rays for the blue region, it might be opposite of what I wrote. All values are made up (read : don't take it literally).

(http://www.game-warden.com/masterpokey/CarrierAssault/2dWHVisualization1.png)

4th edit (someone please post something):
I realized about an hour ago that render-to-texture might not work well; it works perfectly for infinitely-far-away things (the skybox, for example), but sucks for close-up stuff.
Title: Re: Worm holes (having trouble with math)
Post by: Ulala on May 08, 2008, 12:26:53 am
fascinating.  :yes:
Title: Re: Worm holes (having trouble with math)
Post by: watsisname on May 08, 2008, 02:08:55 am
Actually that is backwards from what I believe would happen. Follow the rays in the diagram in the original post to see what I mean.

That's actually exactly how I came to my original conclusion.  Look carefully at the yellow ray in the image in your first post.  Let's designate its original direction as being moving toward -x.  (Thus -x is going left at the top surface).
Now notice that in this view it shows the normal space curving around and meeting back up with the "bottom side" of the wormhole, thus demonstrating how it's a shorter path through the wormhole than from one opening to the other via normalspace.  This means that looking at the bottom surface, -x is going to the right.  So the yellow ray ends up still going in the -x direction... it's direction in normal space never changes.

Going a bit further, imagine in this illustration a new ray entering the top portal from the left side (moving +x).  This would be interpreted as a ray originating in normal space located directly between the two portals.  Following its path through the wormhole we see it exits the bottom portal moving to the left (still +x) which invariably leads back toward the left side of the top portal.  Viewed from normal space, we'd see this ray repeatedly travelling from the bottom portal to the top portal and "teleporting" back.

...somehow I think all this conjecture on ray paths might actually be incorrect since it's being taken from the context of a reduced-dimensional interpretation of a wormhole, and not straight from the actual math.  Still kind of neat to use as a thought experiment.

Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 08, 2008, 02:40:16 am
This is not the finished product. It's just a cool-looking thing that applies distortion with trends similar to what would be expected in a working version.

http://www.game-warden.com/masterpokey/CarrierAssault/WormHoleLensB.avi

Watch and enjoy.
Title: Re: Worm holes (having trouble with math)
Post by: Kosh on May 08, 2008, 03:30:49 am
Is that using 4d equations?
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 08, 2008, 03:23:55 pm
Um, to clear one thing up, this hasn't been yet truely four dimensional stuff.

One can parameterize a location vector in Cartesian coordinate system as:
r(t) = x(t)i + y(t)j + z(t)k

where x(t), y(t) and z(t) are some (preferably continuous) functions of time and i, j and k are the Cartesian unit vectors.

When it comes to the motion of particles, elementarily they are defined by the second time derivative of the location vector:
d2r(t) / dt2

This is the acceleration of a particle.

The actual difference between four dimensional and three dimensional stuff is that in Galilean transformations the t parameter is assumed the same for everyone, while in relativistic stuff t is not at all the same for everybody.

Now when that is said, Aardwolf, it is perfectly explainable that things infinite distance away work well while things closer to the "warp cylinder" do not work so well. This is simply because:

1) A cylindrical "refraction" (or how you call it in this case) system cannot image point as a point to the observer, but it will work as a point to line transformer. For example, you have to think about a star, which is imaged by a cylindrical lens. Now the rays starting from the star are arriving on the cylinder lens think about the local curvature that the ray sees. In other direction, there is no curvature (hence cylinder) and along the perpedicular axis there is normal spherical curvature. So now rays say "Crickey, there is refractional power along the other axis, but no power at all along the other axis!" So, the bastards focus only in the direction of the other axis, while continuing freely and unrivaled along the other axis. Thus the point (star is pretty good approximation of a point) is spread as a line.

2) When imaging a system infinite distance away, imaging is close to perfect since the rays are pretty much arriving parallel to the observer's imaging system's first surface, which allows the imaging system to work as ideally as possible. When the object is closer, there is always divergence added, and thus the image of those objects will appear as blurred (out of focus).

This is not to undermine your work efforts, the effect is quite good. As a side note one could try applying the refraction laws of rays in a cylindrical lens which would have a varial radius and a varial index (several Snell's law calculation required depending on the number of index steps) along the rotation axis on the problem, the effect would be approximately the same for the observer. I'm not sure which is computationally faster though.

I should shut up about this since this is starting to parallel my actual daily work as optical engineer...

Mika

EDIT: Typos
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 08, 2008, 04:22:26 pm
One more thing, you might want to consider using the surface that has minimalized surface area (in rotationally symmetric objects), as the tendency of nature is to arrive in the situation with minimalized potential energy.

Such a curve is defined by y(x)=a*cosh ((x-b)/a), where a and b are constants.

A picture of such surface can be found (photographed) in:
http://www.funsci.com/fun3_en/exper2/exper2.htm

Look at Figure 19.

Mika
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 08, 2008, 04:58:50 pm
You're right about the bent ray being parameterizable in 3 dimensions as

r(t) = x(t)i + y(t)j + z(t)k

for the most part, but as you reach the other side, your parameterization has to squeeze an entire side of the universe into a region the size of the worm hole or less.
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 08, 2008, 05:31:35 pm
I'm not sure if I understood what you meant.

Take a look at:
http://www.cartage.org.lb/en/themes/sciences/physics/Optics/Optical/Lens/Lens2.htm

There are some common lens types included in the page. What I wanted to show is the wide-angle or fisheye lens. There are lenses that can image half of a hemisphere on to a circular detector (actually rectangular but no matter). If you look at the image, there is a location where all red, blue and green rays (fields) cross each other. This is called the aperture stop of the system, and it controls the rays incoming from the half hemisphere (in infinity) that are allowed to hit the detector on the right hand side. The image forms where all the rays from each respective field are brought to a common focus, i.e. the location where all the rays of equal color are brought to a same point.

This is actually a mapping from half-hemisphere to a limited area. This is possible because the photon has actually locational coordinates (call it the location space) and the angular coordinates (call it the angle space). Locational coordinates define where the ray is, while angular coordinates define where the ray is going to go, and there is a relation between them. Note that the above holds well in Euclidian space, while in general situation it might not be so in curved coordinates. But there the rays will still obey the minimized path distance principle.

Mika
Title: Re: Worm holes (having trouble with math)
Post by: Dark RevenantX on May 08, 2008, 05:53:30 pm
The game actually calculating this will **** up framerates.  Just do the simplest thing and have a vector-based system that uses four dimensions rather than three.  Just use a simple geometric model for the funnel.  Approximate where the light will hit you.  End of story.

You WILL commit suicide if you actually try to make this realistic.  Or, more specifically, the computer that actually has to calculate this **** in real time will.
Title: Re: Worm holes (having trouble with math)
Post by: zonination on May 08, 2008, 08:11:25 pm
You should find out how to use portals

(http://a.viary.com/images/blog/avi/portal.jpg)
Title: Re: Worm holes (having trouble with math)
Post by: Dark Hunter on May 08, 2008, 08:13:58 pm
Now you're thinking with portals!  :lol:
Title: Re: Worm holes (having trouble with math)
Post by: zonination on May 08, 2008, 08:22:01 pm
Okay, I've come up with a very rudimentary 3d equation for a vortex, in case you're interested. It's only 3d, but it represents the bending of space-time around a mass, so you can apply it to 4d if you ever get that far.

z= -r^2/(x^2+y^2+1/m) where 'm' is a mass. A mass of 1 is 'large'
Also, make sure that x^2+y^2 > 1/m if m < 0.

Oh, and r is the radius of... something... :P

If you want a worm hole in real physics, you use objects with negative mass. In this equation, if you want a wormhole, set m<0 (but be sure to obey the bounds i gave in the second line above)...

...I'm not a master of 4d, but 3d graphing is what I do in my free time...
...sometimes...

That's a very sexy equation by the way... I wrote that equation on the board today in one of my classes and got a few smiles from some females of the Terran species. :P I rule.
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 09, 2008, 04:47:44 pm
Quote
The game actually calculating this will **** up framerates.  Just do the simplest thing and have a vector-based system that uses four dimensions rather than three.  Just use a simple geometric model for the funnel.  Approximate where the light will hit you.  End of story.

You WILL commit suicide if you actually try to make this realistic.  Or, more specifically, the computer that actually has to calculate this **** in real time will.

One question: how is four dimensional parameterization easier than three dimensional? I'm not sure what do you actually mean by four dimensional at this point? Like physical three dimensions plus time dimension [x,y,z,t] ? Note that even in classical mechanics there are problems that should be called then four dimensional, since they also are parameterized as a function of time.

This is not to say that the computational cost of the real physics stuff is huge. But this information presented in the thread can be used to find out the easiest way of creating a visual that looks approximately the same. Personally this is quite interesting for me at least, since I have been wondering how is the stuff actually rendered in games since there is not time to calculate many reversed ray paths from camera to source. Do the graphics engines actually use rays at all?

As a side note to Aardwolf, considering observer inside the funnel, there are several interesting effects, depending which way do you want the rays to behave. If all the rays coming from the half hemisphere are parallel in one location inside the funnel, then observer in that location will only see a bright spot limited by his field of vision, but no image of the the universe. If the image of the universe is required, then the rays cannot travel parallel in any place of the funnel, there must be some angular divergence left. Then the observer will see the image of the universe, limited by his field of vision. The image is magnified by some factor, depending on the observer's location in the funnel and his field of vision.

If then, a ship would travel in front of the funnel, but not entering it, the ship could be magnified by a massive amount for the observer. However, the image would not be sharp. Though I'm not sure if you could make such an effect with the current graphics engine tools.

I should draw some sketches about this to check if my deductions are right.

Mika
Title: Re: Worm holes (having trouble with math)
Post by: Mika on May 09, 2008, 04:52:25 pm
And the most troublesome topic is how you would like to render a ship that is inside the funnel? Would the rays reflected/emitted by that ship obey the same laws as the rays entering the funnel?

Mika
Title: Re: Worm holes (having trouble with math)
Post by: Aardwolf on May 09, 2008, 05:19:17 pm
Well, no, the fourth dimension in this is not time (as I have said more than once), it is just an arbitrary spacial dimension, such that only three orthogonal axes of the four-dimensional space are used at any point. Sure, you could parameterize everything with three variables, but think what that parameterization would look like.

You can't write a formula in terms of the axial vectors for a point in one of two distinct spaces. The genus of this space is increased by one by adding a worm hole to it, which makes parameterization much much harder and much less linear for one or both sides, when you consider that both sides of the worm hole are approximately infinite.

Unfortunately,
although this idea for a worm hole would be awesome, it's not practical, as to render it would require a ton of math to get it accurately, and an approximation using render-to-texture would be terribly flawed (as I have explained elsewhere in this thread).

What would work, however, is a worm hole like this:

(http://www.game-warden.com/masterpokey/CarrierAssault/0VolumeWH.png)