PDA

View Full Version : Little Demo Thingy


Ian Kerr
2002.08.21, 09:54 PM
http://www.mnsi.net/~rkerr/source/CEGL_August_21_2002.sit


Here is a little demo I made. It is basically just a couple characters spinning around while being animated. There aren't any textures on them or anything yet. I've been working on this file format for a long time (months and months) and I think I finally have all the motion perfected. Anyways let me know if it crashes or anything. If you're using OS 9 you may have to increase the memory. The only thing you as the user can actually do is move the camera...

Keypad 4 - move left
Keypad 6 - move right
Keypad 2 - move down
Keypad 8 - move up

a - rotate left
d - rotate right
z - barrel roll left
x - barrel roll right
c - rotate down
v - rotate up

= - move forward
- - move backward

P.S. If you remove the model files from the folder the app will crash. If you remove the .mot files you will be able to see the models in their default positions. Oh and it uses GLUT for keyboard input so the input is pretty choppy. When I toss in GetKeys it will be much smoother.

monteboyd
2002.08.21, 09:58 PM
Works fine on the iMac350 Rage128 here at work. Under OS9.1

OneSadCookie
2002.08.21, 10:08 PM
Seems fine here (G4733, GeForce2MX, MacOSX10.2).

Mars_999
2002.08.21, 11:31 PM
Smooth animation on a "read signature"

Ian Kerr
2002.08.22, 01:14 AM
Thanks for taking the time to test it out guys.

GoodDoug
2002.08.22, 01:18 AM
Runs smoothly on my Machine (G4x2 450, Radeon, OS X Server 10.2)

aarku
2002.08.22, 01:26 AM
Doubt if it's a system you were intending it to run on... but...

Works fine on a G3 Beige MT 266/Rage IIc (6MB)/OS 9.2.2

It just gets like 4 frames/sec... that's all.

-Jon

aleph0
2002.08.22, 01:15 PM
It works fine, however, the black model seems to animate incorrectly, when it animates, it looks like certain strips of triangles are disconnected from the model.

I don't know if this is supposed to happen (because of how the model looks, it's hard to see as it's flat shaded) but I thought I'd point it out:

Edit: image removed

-- A

Ian Kerr
2002.08.22, 01:46 PM
Thanks for taking a look at it. Yeah you can't really tell since it's flat shaded but it's supposed to be like that. The thing around his chest is a little dragon skull and he has pointy triangle like things sticking out from his armour in different places.. :)

aleph0
2002.08.22, 01:48 PM
OK, I'm going to remove the picture from my server then.

BTW: I read your diary and it all looks very interesting, though it seems that you are only working on the graphic side of your system, do you have other stuff in place already? (music, sfx, scripting, networking, etc.)

-- A

Ian Kerr
2002.08.22, 04:54 PM
I've mostly been working on the graphics because I want to make sure I don't start a whole bunch of stuff (scripting, networking, sfx) and not finish any of it. I'd rather get a decent graphics engine working first and then add scripting and sfx.

I think for sound I'll end up using some sort of 3rd party API for now until other engine features are finished. I'm not sure what I'm going to do about networking yet. I do have collision detection set up, but I need to do some more work on that before it is finished.

I am gong to start making a game with the engine now. That should give the engine some "street value". It's one thing to throw some models up on the screen, it's another to actually have them responding to input, reacting to collisions, etc. The engine is going to be a huge help, and I guess that's the whole point in having an engine :)

Ian Kerr
2002.08.23, 12:09 AM
http://www.mnsi.net/~rkerr/source/CEGL_August_22_2002.sit

Here is the latest. You actually get to do something this time! :) There is a readme included. There isn't interpolation between frames or animations yet. Let me know if it works and stuff..

OneSadCookie
2002.08.23, 06:32 AM
Very smooth (iMac 600, Rage 128 Pro 16MB, 10.1.5).

Seems to be fill-limited (goes noticeably slower when zoomed in) -- guess that's normal for this card :)

Iceman
2002.08.23, 06:35 PM
I have an iMac ati rage128 8mb of vram and 500mhz g3. The up and down arrows move super fast, and everything else runs fast. I also experienced the slow down while zooming in while not too noticeable. Is this due to how the textures are being displayed or loaded?

Iceman

aarku
2002.08.23, 07:06 PM
Again, not sure if it will be an officially supported system... but I was screwing with your new version and on my g3 minitower 266/rage IIc 6 megabyte OS9.2.2 computer it works well (just obviously slowly) but then I resized the window into something smaller (which gives better framerates), and that was fine too except after a few seconds of "attacking" (pressing space) the program quit. (No error message displayed just quit.)

So I'm not sure if its anything but I thought I'd just report it. I don't know of any other testing I could try to help and track it down any furthur.

-Jon

Ian Kerr
2002.08.23, 11:21 PM
Iceman, I have the same card and it does the same thing to me. It used to do this even back when I had a 32x32 particle texture and zoomed in on it so I guess it's fill rate limited like OneSadCookie said.

I have a question because I don't know much about fill rate limitations. Is a card either fill rate limited or not fill rate limited or do all cards suffer from this to a certain degree?

Jon, you found a bug. There was a memory leak going on there. I booted up in OS 9 and found it and got rid of it. I'm currently changing the camera code a bit and trying to squash another bug.

OneSadCookie
2002.08.23, 11:49 PM
There are a number of basic limits that all 3D cards suffer from. Precisely which (if any) of those limits you hit, though, is dependent on your program and the particular 3D card in question.

"Fill Rate" refers to speed that the card can fill pixels in the frame buffer. That means that whenever you draw two overlapping polygons, you're wasting fill rate*. This is typically affected also by the size of your textures, whether you have blending, alpha-testing, multitexturing, &c turned on.

"Transform Rate" refers to the speed that world space vertices as supplied by you can be turned into 2D screen coordinates. On modern graphics cards with hardware transform & lighting, it's very difficult to hit the transform rate of the card. If you were just drawing 1-pixel points you might come close, but you're probably more likely to end up bandwidth-limited...

There's a certain amount of bandwidth available from the CPU/main memory to the video card. Each vertex you send chews up some of this bandwidth. Uploading textures (for example, if textures have to be paged or you use dynamic textures) uses significant amounts of this bandwidth. If all your textures are static and all fit into VRAM, you're unlikely to hit this limitation.

----------

* The ATI Radeon and later cards, and the NVidia GeForce4Ti (?) and later cards have an early-out if the z-buffer test is failed. That means that you can dramatically save on fill rate by drawing front-to-back.

Ian Kerr
2002.08.24, 02:45 AM
Jon here is my fixed version. I tested it in Classic and it seemed to work fine. If you wanted to give it a try that would be great.

aarku
2002.08.24, 04:28 PM
Originally posted by Ian Kerr
Jon here is my fixed version. I tested it in Classic and it seemed to work fine. If you wanted to give it a try that would be great.

Works great, can't find any problems.

-Jon

Feanor
2002.09.01, 05:27 PM
Hello,

nice work. What did you design the models and textures with?

I had great performance on my geforce2 card. The second demo with the Dwarf doing his little dance gets a bit disturbing after a while. "How does he do that so fast and not get tired or wreck a knee?"

I'd like to be able to rotate the model.

--FÎanor

Ian Kerr
2002.09.01, 11:16 PM
Thanks for trying it out :)

I designed the model a year or so ago in Animation Master (www.hash.com). The animations were done in Animation Master too. I painted the textures in Photoshop.

The animations for the dwarf run at almost the right speed on my Rage128, still a bit fast though. Once I add frame interpolation, you'll be able to set the speed of the animation so that it will run at the same pace on all computers. If you want to get a different view of the model check out the readme, I *think* it lists camera controls.

codemattic
2003.02.14, 02:44 AM
Originally posted by Ian Kerr
I designed the model a year or so ago in Animation Master (www.hash.com). The animations were done in Animation Master too. I painted the textures in Photoshop.

Ian,
Do you like A:M?? Im thinking of getting A:M 2003 - since they promise that this version will eventually be Mac OS X native. How well does it work in the classic environs?

Unfortunately their SDK only runs in windows - and isnt opensource.

So I was wondering how difficult is it to read in models and animation file formats from A:M? Are their file formats still text based and well documented? Do you have any example code you could share? What triangle-based formats will A:M export to - can I export to dxf or something?

In your code are you reading in the actual spline patches and rendering those - or have you already triangulated it?

I really only plan to use it for game modelling/animation (I wont be rendering stuff in A:M) - so if I cant figure out how to read the files it wont be useful for me.

thanks,
Codemattic

Ian Kerr
2003.02.17, 08:12 PM
Originally posted by codemattic
Ian,
Do you like A:M?? Im thinking of getting A:M 2003 - since they promise that this version will eventually be Mac OS X native. How well does it work in the classic environs?


I do like Animation Master, but there are some significant drawbacks. The version that I have will not run in Classic. I have to boot into OS 9 because the program will not recognize the cd. The newer versions do run in Classic. You might want to wait until their OS X native version comes out before you plunk down your money for this years subscription. The OS X version may very well come out this year but it will most likely take them several months after that before they get a semi stable version out.


Unfortunately their SDK only runs in windows - and isnt opensource.

I've never tried to use their plugin SDK but I do have documentation for some of their model formats. I also have an "A:M Viewer" with source code. Both of these a year or two old though.


So I was wondering how difficult is it to read in models and animation file formats from A:M?

I have written file loaders for their .ply (polygon mesh, bones, texture information), and their .mot (animation file that can be applied to the bones in a .ply). Both were fairly easy to write with the help of their documentation. I don't use all the data in the formats however, some of it is simply discarded.



I have documentation for several of their file formats. The documentation is lacking in some areas but I was able to figure it out. I don't think they have documentation for their text based formats, but I haven't checked lately.

[B]
Do you have any example code you could share?


Yes, but the code is very dependent on my game engine's data types. If you still want to see the code let me know and I'll upload it.


What triangle-based formats will A:M export to - can I export to dxf or something?

The version I have can export .dfx, .ply and .3ds. I have had very little luck with their import/export features though, especially .3ds. It seems like my mesh or u/v coordinates always get messed.


In your code are you reading in the actual spline patches and rendering those - or have you already triangulated it?


I haven't written an importer for their .mdl format (which uses patches). My .ply importer reads in polygons, bones and u/v coordinates. Then I triangulate the mesh and triangle strip it.


I really only plan to use it for game modeling/animation (I wont be rendering stuff in A:M) - so if I cant figure out how to read the files it wont be useful for me.


This is a tricky one to answer. Basically if you can do all your modeling/animation in Animation Master and the .ply exporter works well (which it should) then I think you'll be set. I wouldn't depend on being able to transfer your A:M models/animations to other programs for tweaking. I think you'll be able to figure out how to read the files. Right now I'm writing my own editors to tweak the meshes and bones and export back to .ply so I don't even need to use A:M for some things.

Hope that helps, let me know if you want more info.

-- Ian Kerr

codemattic
2003.02.18, 03:50 AM
Originally posted by Ian Kerr
I have written file loaders for their .ply (polygon mesh, bones, texture information), and their .mot (animation file that can be applied to the bones in a .ply). Both were fairly easy to write with the help of their documentation. I don't use all the data in the formats however, some of it is simply discarded.
Interesting... I didnt know that .ply supported bones - so I was wondering how you did the animation. Now it makes sense.

Yes, but the code is very dependent on my game engine's data types. If you still want to see the code let me know and I'll upload it.
Sure! Any code that involves inporting and loading models Im interested in learning from.


Hope that helps, let me know if you want more info.

-- Ian Kerr
thank you very much for your help. Ill probably get A:M now (they promise it runs in classic) and hope it is relatively stable and that the OS X version isnt long in coming.

thanks,
Codemattic

Ian Kerr
2003.02.18, 07:57 PM
Here is the source c++ source code. I use CW 7 so that's what the tabbing looks best in. Keep in mind that I throw away a lot of the information in the format since my game engine doesn't support it. I strongly recommend reading the documentation. If you can't get it from Hash I can stuff it and upload it for you.

http://www.mnsi.net/~rkerr/source/CEGL_PLY.h
http://www.mnsi.net/~rkerr/source/CEGL_PLY.cpp


--Ian

codemattic
2003.02.24, 08:05 AM
Thanks for posting your .ply loading code. It helps a lot. I always like working with ascii formats - because I can read them and better understand whats going on - and of course no endian problems. I have to start biting the bullet and write loaders for binary formats.

thanks,
Codemattic