What kind of math would be involved in making this pseudo-3D engine?
Displaying 1-11 of 11 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
blues_zodiakos

I've been toying with the possibility for a long time to do a Wing Commander like game. I've played Freelancer, X:Beyond the Frontier and X2:The threat, Freespace 1&2, Privateer 1 & 2...

I'd be interested in making a game very similar to X2, but utilizing an advanced version of the original Wing Commander engine.

Creating the ship designs would probably not be too hard, as I have 3D modeling software coming out all of my orifices. My main issues are the math involved.

I'm trying to wrap my brain around the concept of 3D math when dealing with 2D objects, as all of the objects in the game would be 2D billboard objects chosen for display based on their distance from the camera and orientation. I'm sure there's some simple mathmatical formula for determining, from the camera position and angle, and the orientation and position of an object, which bitmap to display. I just can't think up a good system for it, however. It would be so much easier if I could get ahold of the source code for the original Wing Commander.

Posted on 2005-01-30 03:23:05

basil

I'm not familiar with the game, but if you're talking about having a single image that distorts according to where the viewer is (like trees/bushes etc in early FPS's), it would involve all the regular 3d maths (i.e. matrices) plus you'd need to texturemap. Texture mapping is possible, but not feasible unless you're doing very few images. Talk to Omni.
Also the technique of using a single bitmap that is always facing you is mega annoying.
Don't take this as me saying you shouldn't do it, just if you are in fact talking about what I think you are, it will be difficult and you'll be limited for processing power.

Posted on 2005-01-30 05:15:30

Omni

Yeah, texturemapping might not be the best idea if you're going to have tons of objects.

However, even though the rotating/scaling sprites idea may be annoying (think: every single object in Mario Kart) it is still quite possible, especially if you add some animation to it (I remember that Mario Kart sprites had different animations when viewed from different angles, so it wasn't just the same annoying sprite frame all the time).

Essentially, rotating and scaling sprites in 3D involves creating 3D vectors (one for each image), rotate them using a matrix. This gives you the position of the upper left hand corner of the image.

To scale the image according to distance, create a second vector with the same Z element but the X and Y element are the width and height of the lower-right corner.

ex.

vector1.x = 50
vector1.y = 50
vector1.z = 200

//Second vector, lower-right corner of image
vector2.x = vector1.x + ImageWidth(sprite)
vector2.y = vector1.y + ImageHeight(sprite)
vector2.z = vector1.z


This would be enough information to do a scaling sprite. Rotating sprites...well, I can't quite think of how to do it at the moment. Use the above two vectors to calculate the size of the image, scale the image, and then Rotate using RotScale or something.

For information on matrix/vectors/datatypes and stuff, and how to set it up in code, go here.

3D Coding Blackhole

Read about the math and the code for the transformations. You don't really need anything else involving polygons, but it's a good read if you're interested. This is what I'm trying to base my 3D code off of...if we ever see it again :) Basil, you have any good links for 3D info?

Posted on 2005-01-30 09:15:35

anonymous

google 3dica

-basil

Posted on 2005-01-30 16:19:06

Omni

hey, spiffy.

Posted on 2005-01-30 17:07:04

blues_zodiakos

Yeah, the Wing Commander technique used no polygons at all, just 3D bitmaps which were displayed and rotated according to the angle that you were viewing them. In Wing Commander, the number of bitmaps needed was significantly decreased because only 2 of the 3 vectors needed to be rendered (one of them would simply be a rotation factor instead). Also, Wing Commander used 15 degree increments, and most of the sprites were mirrored, so only 12 images were needed for each strip, and thus 144 images unique images total were needed for each sprite. The images themselves were all 16 color (later 256 color), and thus compressed extremely well with RLE compression.

I would actually like to do a much more ambitious version of such an engine, because I'm not really working under size constraints. I would like to work in 1 or 2 degree increments, and most of the ships would NOT be mirrorable. Thing is, however, that while they had to do the majority of the sprites for Wing Commander by hand, all of the batch rendering for my game would be handled automagically by Maya - the only thing I'd have to do is model my ships and let Maya render the views automatically.

I think I'd like to do a proof of concept first, though. Wing Commander's capabilities, while awesome at the time, are extremely crude compared to what we can do today even on the lamest of computers. I'd like to see how well a 3D, prerendered 'bitmap' can stand up to spiffy polygon models.

edit: I'm not sure my math is correct on how many images were needed. That might be an overestimate because some images might be duplicates. I hate math. Die math die.

Posted on 2005-01-30 21:48:00 (last edited on 2005-01-30 21:51:02)

Omni

...My word, someone has mentioned this method of rendering before. Like some whacked-out Pre-Rendered NeoGeo game like Pulstar.

...However, I think that person mentioned his model's sprites were approaching 8 GB in size, rendering it at every angle possible. This might have not been the smartest thing in the world.

Posted on 2005-01-30 22:10:41

TomT64

This is a good game math link:

http://echellon.hybd.net/issues/5/articles/circle/sincos.htm

It's kinbd of Allegro based but a good programmer should be able to translate it to whatever.

Posted on 2005-02-01 12:13:27

KilloZapit

I often wondered this myself sort of, though the application of it was far different. What I want to do someday is create a SaGa Frontier style pseudo-3D battle field. In theory, I could do this entirely with mode 7 style scaling effects, however I am not entirely sure how I would get the camera to rotate around properly.

Posted on 2005-02-02 12:38:36

anonymous

Zonker, too lazy to login :)


www.sharelegal.com/Sebtemp/preview/3dshooter.rar

I hope this helps you out.

Posted on 2005-02-03 16:55:14

Omni

Zonker: That's really cool :)

Posted on 2005-02-03 21:46:26


Displaying 1-11 of 11 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.