5 ms·
I love 4D graphics. Many years ago, in my freshman year of college, I wanted to create a 4d space game, and spent about a year grinding out an OpenGL rendering
by pnathan 6y ago
I love 4D graphics.
Many years ago, in my freshman year of college, I wanted to create a 4d space game, and spent about a year grinding out an OpenGL rendering engine. I taught myself the requisite mathematics and realized that my conception of hyperspace as operative in my game, was fundamentally wrong. So I moved on. Still have the code laying around, although I lost the Linux port I ginned up at one point. Really should polish it and release it. :)
- beaumayns 6y agoI'm curious, in what way was your conception wrong? Sounds like it could still be interesting.
- pnathan 6y agomy initial thought was that hyperspace would allow a _shortening_ of the distance traveled from point P0(x,y,z,q) to P1(x,y,z,q). Since I was _really_ into space combat games at the time... that would have been really cool! However, - and this is obvious when you work through it - when you use Euclidean distance (https://mathworld.wolfram.com/Distance.html https://mathworld.wolfram.com/Distance.html - see the General equation), the distance travelled increases, thus obviating a key part of my game, which was to "jump" through hyperspace to shorten the trip. I didn't care to rewrite math enough to make the game work out, and since I'd spent so much time learning math, graphics,and larger-scale program design, I was burnt out. It was a great experience. One day I might return to the notion, but it'll be around the hyper-dimensionality experience, not as a combat game. I don't like the slice mode of 4D games qua the OP, I far prefer projections from 4D as a way to understand the 4D realm.
- joekunin 6y agoI would love to know more about the kind of math involved in this.
- pnathan 6y agoThe simplest answer is that I was aiming at doing a projection from 4D into 2D. 4 dimensions in Euclidean space have 6 planes. A 4D rotation thus has to have a ton more of sine/cosine calculations than a 2D one. Projections down from the 4th induce this as well. You have to project each point into the space you're visualizing. I didn't really get into camera / FOV calculations, I kept that fixed, don't remember much about those decisions. It was 2001 when I started the project, and I took a final swing around 2005 to get a final thing. Not sure of the state of the information today, but at that time, I was unable to find almost anything about the mathematics involved in the 4d->3d work. I was a freshman at a community college, literally printing off articles from Wolfram and interlibrary loaning books on graphics. I had to deduce from the principles of 3d->2d projection what it'd take to do a 4d->3d projection. I went on to take a minor in mathematics and retain a good deal of that information even now. Given an adequate graphing/windowing context with a PutLine/PutPoint in 3d or 2d, I could cook up a 4D library over a weekend of focus. I just don't know what to do with that library besides goofing off rotating a cube or whatever. N.b., one of the issues with doing something here is that you really need a 4D CAD tool. Think Blender, but 4D. Otherwise you're laboriously typing in `Point p = new Point(0,0,0,1); Point p2 = new Point(/ugh/);` or some such, maybe in a text file. Haven't looked into the area in, you know, 15 years. Maybe there's such a tool out there today.