Basic 3d engine
Displaying 1-20 of 32 total.
12 next
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
basil

Go have a gander. Lacking any real camera functionality it's mostly a novelty. Pretty choice nonetheless.

http://www.verge-rpg.com/files/get.php?id=469

Posted on 2004-07-14 11:38:36

zaril

Cool, the computer at work gets 2 frames per second on that. ;) I haven't dared check what the hertz is on this baby.

Posted on 2004-07-14 12:27:48

Buckermann

Nice.

But I don't think that the FPS display is correct. While my PC is old and slow, the demo is certainly much faster than 1 FPS.

Edit:
Stupid me. The framerate display is actually how may 1/100 seconds each frame needs. So, 1/100 is more like 100 frames per second!

Posted on 2004-07-14 12:46:02 (last edited on 2004-07-14 12:52:28)

Omni

This is very good. I was thinking about making my own 3D engine when I had the time.

It also gets a lot of FPS. 3/100 centisecs on my PC = approx 33 frames per second.

We'll talk. Does it have any kind of Z-ordering or clipping or anything?

If you've got matrix rotation down, too, then you've got a great grasp of this stuff. I'm just now beginning to understand it...

Posted on 2004-07-14 14:19:45

mcgrue

Basil:

You are a madman. That is awesome.

That is all.

Posted on 2004-07-14 14:20:06

Omni

Okay, more talk time.

You've got z-sorting..which is really. Good.

Is this just a demo, or are you planning on refining it for general usage?

There's a bit I'd like to know about the demo. Does it support hierarchial object model spaces?

I've got my own idea for a 3D engine...uh...API thingagummie. Basically, all the data is in arrays, like yours. But you are given handles to the arrays. Like:


int vectors[TOTAL_VECTORS][4];

int V(int x, int y, int z)
{
Create vector in the vectors array, and return the pointer.
}

myvector = V(500, 200, 30);

DrawVector(myvector);


Stuff like that. All the drawing functions would look in the arrays at the given location for the drawing info. The idea is that it should be nearly second-nature to throw together a polygon on a single line of code.

I'm still working on hierarchial object models..I can't figure how I should do it, since V3 can't nest structs.

This is assuming, of course, that I ever actually get around to programming it.

You've done that, which is really cool. 3D is really a viable thing to do with Verge3...it doesn't mean you need a whole bunch of polygons and huge models, but just 3D mathematics in general is pretty neat. Great job!

Posted on 2004-07-14 16:33:04

rpgking

Wow, that is awesome. I was surprised to see it run so fast on my PIII 600mhz..

Posted on 2004-07-14 17:50:30

basil

Yes, z sorting is in. I looked at z buffering but it would entail having to rewrite the triangle function. The exisiting one is fast enough for me and besides z-sorting is good enough for most purposes. I almost had lambert shading in, but was having some trouble getting the triangle normals pointing the right way.

At present it can handle a maximum of 550 triangles, any higher and it crashes in what seems to be the recursive quicksorting. Don't fully understand the situation though. It can go much much higher with bubble sorting, but consequently it slows to a crawl.

"Does it support hierarchial object model spaces?" I don't know what that is, so no. I learnt just enough about 3d rendering to create this, I'm still pretty ignorant about the subject.

And at present I don't have any plans to take it further, at least not for a while. The uni break is over and this has been a large source of distraction. It was too much fun to abandon it forever though :)

Posted on 2004-07-14 21:34:44

Interference22

Dude! That's excellent! If this thing had texture mapping I'd probably have a seizure! Yay!

Posted on 2004-07-14 23:18:59

Omni

Okay, hierarchial object models...quick lesson.

Your head. It can rotate 90 degrees clockwise or counterclockwise, right?

It also has a relative position: of being on top of your body.

This is a hierarchial object. The head object, which has it's own angle and position, is a child of the "body" object.

To render a hierarchial object, you render the highest level (the body), then you use the body's position to calculate the head's position (ie, the head MUST be 60 centimeters from the torso). You then calculate the sub-object (head)'s angle using the angle of the torso.

For example, if the body is rotated 90 degrees, then the head is of course rotated 90 degrees. But if the head is turned clockwise, it is rotated even further.

You do this in object space. Translate the head and angle it in object space, then position it in the object space of the torso.

That's...basically a hierarchial model. Make sense?

Don't worry, this is still a great job.

Posted on 2004-07-15 01:23:05

Omni

Also, I forgot! Excellent choice on z-sorting. I believe real z-buffering would require managing every z-point on each polygon, and that would have royally sucked any speed out of this Verge choice.

What point do you use for z-sorting? The farthest z point on the polygon, the closest, an average, etc...

Also, real goodness texture mapping is not going to be possible unless you want to immediately kill the FPS altogether.

However, just stretching a texture across a polygon (similar to ika's DistortBlit() is quite possible.

Posted on 2004-07-15 01:25:21

mcgrue

Basil, this is so uber awesome it's silly.

I don't dare look at the codebase yet, being busy, but would you rate it as capable of doing 3d things like adding rotating 3d polys into a 2d battle system for various wacky spell effect fun?

Posted on 2004-07-15 02:08:37

Troupe

IGNORE ME ;_;

Great work!

Posted on 2004-07-15 02:39:01 (last edited on 2004-07-15 02:41:54)

basil

"would you rate it as capable of doing 3d things like adding rotating 3d polys into a 2d battle system "
I guess you could, but it would depend what you had in mind. I didn't get time to investigate camera functionality, but from what I gather it's not a great deal more calculation. With a proper camera you could do all kinds of nutty things. When I think about it that's probably the best idea for actually implementing something like this. I'd love to see it, so somebody go work on it :P

If you were going to look into something like that I guess you'd need some proper animation techniques rather than just specifying angles and displacements. By the way, object scaling can also be done with extreme ease, I just didn't put it in as I didn't see a need for it.

As for the z sorting, yeah it's probably the best bet. It has some wierdness every now and again, but if I'm not mistaken it was all the Playstation had and it did fine. To answer your question, it's based off the sum of the z values of the 3 vertices.

And textures would be very cool indeed, but well beyond what I can pull off. I recall Skarlath had something of the sort in v2, but I don't have his script anymore. Skarlath was a bit of a legend really.

Posted on 2004-07-15 06:48:58

basil

Cheers for the explanation RE hierarchial object models Omni, it makes perfect sense

Posted on 2004-07-15 06:56:29

mcgrue

Well, in most 2d battle systems, you're loking at a static camera, so you really don't need to worry about moving the POV.

Posted on 2004-07-15 07:36:38

Omni

Would you really need a camera for this?...

Basically, I think all you'd need to do is just

1) create the needed objects
2) project them to 2D coordinates
3) THEN translate the 2D coordinates to the position on the screen where you wish to blit the object.

Maybe? This is really 3D graphics fundamental theory, I think, and I'm just shooting at air, as I haven't made or experimented with a 3D engine yet :)

Posted on 2004-07-15 15:35:02

basil

Well, when I say camera I mean a moveable point of view. So instead of always projecting onto the screen as if you are looking down the z axis you create the illusion of moving all around the object. What you described above is in effect what's going on currently.

But both of you are correct, you wouldn't need a camera for such a purpose. I'll have a think about it, it definitely warrants some investigation...

Posted on 2004-07-15 22:02:26

zenogais

That example is awesome, hopefully there's more to come. Also, the Playstation didn't even have z sorting, it took a bit of trickery(sorting) with packet orderings to the GPU to achieve that effect.

Posted on 2004-07-18 09:04:54 (last edited on 2004-07-18 09:38:32)

Omni

Huh. The Saturn used Z-sorting.

Which, I was wondering. The Playstation uses three-sided primitives (triangle polygons), right? And I'm certain the Saturn uses four-sided quads. Now, technically, a quad is made of two triangles.

The Saturn's polygons per second rate is 200,000, and I think the Playstation's is a little bit more...but don't you think the above means that the Saturn is actually rendering twice as many three-sided polygons as the Playstation?

I don't know how many polygons we could get Verge to render if we could avoid any memory problems, but I bet it'd be less than a Sega 32X.

Which, by the way, I tried to declare the three arrays for vectors, matrixes, and quads in Verge. Each array was size 200,000. I think Verge crashed.

At one point, I used 200,000 only for vectors and matrixes, and Verge was happily consuming near 20 megs of memory, but I just decided there was no way I was gonna use that much RAM when Verge couldn't really draw 200,000 anyway. I think I cut it down to 50,000 for quads and matrixes, or something.

Pipe dreams :)

Posted on 2004-07-18 16:58:19


Displaying 1-20 of 32 total.
12 next
 
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.