IonicWind Software

Aurora Compiler => 3D Graphics => Topic started by: Ionic Wind Support Team on July 12, 2006, 11:03:51 PM

Title: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 12, 2006, 11:03:51 PM
I have been working on the official 3D library lately.  Should be partially included with the next update.

Will be contained in a (small) DLL similar to the one I wrote for IBasic Pro.  It is class based, of course, and supports multiple rendering windows.

Title: Re: Aurora's 3D engine
Post by: Barney on July 13, 2006, 05:55:50 AM
Great news! :)

Don't forget to put orthographic projection mode in. ;)
It's invaluable for HUD''s and some editors.

Barney
Title: Re: Aurora's 3D engine
Post by: Zen on July 13, 2006, 06:44:00 AM
Woo Hoo :D

Lewis
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 13, 2006, 10:34:34 AM
Here is an example of the basic structure of the engine.  Doesn't do much but create the rendering window and a camera at the moment. But it shows the simplicity of using it.


global sub main()
{
C3DScreen s;
C3DCamera c;
s.CreateWindowed(0,0,800,600,AWS_CAPTION|AWS_VISIBLE|AWS_SIZE,0,"3D Test",NULL,true);
c.Create(s);
c.Position(0,0,-8);
c.Orient(0,0,1,0,1,0);
c.SetBackPlane(500);
do
{
s.Clear(RGBA(0,0,255,0));
s.BeginScene(c);
s.RenderScene();
}until GetKeyState(0x1B);
}


Since it is class based the destructors of the objects handle closing the screen, freeing the camera and the little nit picky details that procedural based implimentations face.
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 13, 2006, 10:33:31 PM
This is going to be great and now get me to buckle down and start trying to learn Aurora instead of walking away confused with all this new stuff :)
Title: Re: Aurora's 3D engine
Post by: Rock Ridge Farm (Larry) on July 14, 2006, 05:31:38 AM
When will you release the new compiler with this in it or should it work now?
Can't wait -- a new thing for me to get lost in.
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 14, 2006, 09:06:03 AM
You have to wait for the update of course ;)
Title: Re: Aurora's 3D engine
Post by: Rock Ridge Farm (Larry) on July 14, 2006, 09:12:49 AM
OK - Impatiently waiting.
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 14, 2006, 11:03:58 PM
And the engine progresses.   


global sub main()
{
C3DScreen s;
C3DCamera c;
C3DMesh m;
C3DObject scene;
C3DLight light;
s.CreateWindowed(0,0,640,480,AWS_CAPTION|AWS_VISIBLE|AWS_SIZE,0,"3D Test",NULL,false);
c.Create(s);
c.Position(0,0,-150);
c.Orient(0,0,1,0,1,0);
c.SetBackPlane(500);

m.Load3DS(s,GetStartPath() + "defiant.3ds",true);
m.Scale(.2,.2,.2);
m.Position(0,-20,0);
m.Rotate(-22.5 * .01745,180 * .01745,0);
m.EnableLighting(true);
m.UseVertexColor(false);

light.Create(s,LIGHT_POINT,1);
light.Position(0,20,-150);
light.SetAttenuation(0,1/50.0,0);
light.SetSpecular(.5,.5,.5,1);
light.SetAmbient(.3,.3,.3,1);

scene.CreateScene(s);
scene.AddChild(light);
scene.AddChild(m);

do
{
s.Clear(RGBA(0,0,0,255));
s.BeginScene(c);
scene.Draw();
s.RenderText(0,10,"Test",RGBA(255,255,0,255));
s.RenderScene();
}until GetKeyState(0x1B);
Scene.Free();
}

Title: Re: Aurora's 3D engine
Post by: Rock Ridge Farm (Larry) on July 15, 2006, 08:49:21 AM
Now that is cool - How did you make the .3ds file?
Title: Re: Aurora's 3D engine
Post by: Zen on July 15, 2006, 09:06:06 AM
I think it is prpobably a free model from somewhere, then again Paul is a man of many tallents. I am learning 3d max 8 at the moment, just as a hobby, not planning on doing anything with it. But here is something i made last night...

Its sort of a futuristic weapon, but its sort of turned into a space ship looking thing now, anyway this was a perspective render i did, then i put it into photoshop and did the text etc. I believe Thanatos comes from ancient greek for death, which seemed appropriate for a weapon.

Lewis
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 15, 2006, 10:43:52 AM
Actually I downloaded the .3ds from trekmeshes. 
Title: Re: Aurora's 3D engine
Post by: Barney on July 15, 2006, 01:41:49 PM
He, he... Do we have a trekkie here? ;D

Specifically, a member of Deep Space 9 fan club?

Yes. Trekmeshes is an excelent resource for good meshes.

Barney
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 15, 2006, 01:45:07 PM
I'm a fan of all of the shows, not neceissarily a fanatic though ;).  The defiant was a cool ship, basically a flying weapon.

Title: Re: Aurora's 3D engine
Post by: Kale on July 15, 2006, 01:54:49 PM
I love the Star Trek : Next Generation series. I have all of them on dvd. My girlfriend loves me watching them all from time to time! /sarcasm off  ;D

I'm going to see Patrick Stewart in Shakespear's, Antony and Cleopatra next month too.. i can't wait!

BTW: very nice implementation of the 3D engine. Aurora is shaping up to be a fantastic language and one which im beginning to love. I'm seriously considering writing a game i have planned using it. Hopefully the language will grow and move from alpha as my project moves on. :D
Title: Re: Aurora's 3D engine
Post by: Zen on July 15, 2006, 06:34:03 PM
Quote from: Paul Turley on July 12, 2006, 11:03:51 PM
Will be contained in a (small) DLL similar to the one I wrote for IBasic Pro.  It is class based, of course, and supports multiple rendering windows.

Ok so how small is small? IBasics one was 1.36 mb, will it be around the same size or smaller? Also, how come we cant just use the DirectX runtimes instead of using out own DLL? I think i remember it had something to do with when microsoft update DirectX but im not sure on the details.

Lewis
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 15, 2006, 07:01:02 PM
A bit smaller, but not too much.  Depends on how much I actually add to it.

The d3dx9 static library from Microsoft is only compatible with VC++.  And it isn't available in an official runtime library, only a debug DLL.  Yes you can interface through COM for basic functionality.  However if you want to use skinned X meshes, shaders, advanced T&L, etc. Then you have to be able to access that library.

Also I already have a huge library of 3D sources written in VC++ 6.0 and the time to take to convert them to Aurora wouldn't be of any benefit.  Whether it's 1+ MB in a DLL or 1+ MB in an Aurora LIB doesn't change in the final output.

Paul.
Title: Re: Aurora's 3D engine
Post by: Zen on July 15, 2006, 07:04:01 PM
Ahh so the actual dll written for IBasic was done in C++ then? I guess it all makes sense. I dont understand why microsoft support prety much everything else for other languages but not DirectX other than a debug DLL, silly really.

Lewis
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 15, 2006, 09:10:06 PM
Since Aurora will eventually work in Linux... will the 3d engine use opengl and you are just using directx to develop right now? Or will all programs written for Windows or Linux have that directx dll requirement?
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 15, 2006, 09:49:50 PM
There is no DirectX on Linux natively.  It will have to be OpenGL.
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 15, 2006, 09:51:14 PM
Quote from: Zen on July 15, 2006, 07:04:01 PM
Ahh so the actual dll written for IBasic was done in C++ then? I guess it all makes sense. I dont understand why microsoft support prety much everything else for other languages but not DirectX other than a debug DLL, silly really.

Lewis

Because gaming is a big industry and they can hold more cards this way.  Their compilers, their graphics standard, their way.
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 16, 2006, 01:33:16 PM
Using ibasic standard and darkbasic pro, I have been only using directx. But I think going with opengl will be better just that you are not dictated to by one company and will have a well open ended future on anything you wish.

So I take it this upcoming stuff is just for getting maybe the language structure worked out and then you will change it to work with opengl on both windows and linux with no need for directx?
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 16, 2006, 01:42:08 PM
OpenGL for Linux, DirectX for Windows.

OpenGL on Windows has it's problems.  Driver issues, slow rendering, etc.  Which will be made even worse when Vista comes out.

By using a high level class library I can make both function identically.
Title: Re: Aurora's 3D engine
Post by: Barney on July 16, 2006, 01:49:20 PM
I am running Vista for quite some time now and OpenGL is definitely not supported so there's no way to escape DirectX and quite frankly I don't see why would we. I am not big MS fan but most of our customers come from Windows world and from next year on people will be getting their new machines with Vista preinstalled. That's why DirectX is a must, whether we like it or not...

Barney
Title: Re: Aurora's 3D engine
Post by: Zen on July 16, 2006, 01:51:14 PM
I quite like vista. I too have been using it for the last 4 or 5 months and although it still has a long way to go, its quite stable compared to how XP was at that stage. Also Aurora runs just fine and dandy on it ;)

Lewis
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 16, 2006, 01:57:43 PM
Wow, you mean we just write our code and Aurora will handle wether it is directx for windows and open gl for linux. That is something I never heard of. That right there would make Aurora very unique wouldn't it? Once the word got out that you write with one source and it works on both platforms, that sure sounds like a winning sales point to me.
Title: Re: Aurora's 3D engine
Post by: Zen on July 16, 2006, 02:02:25 PM
Well i just posted a new thread just to confirm that but i believe that its true. The way Pauls is designing the libraries should allow us to type the same code in linux and windows and it should do the same thing. Not just in 3D but in all aspects of Aurora.

Lewis
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 17, 2006, 12:58:30 AM
Direct Input class now works (for both 2D and 3D).  So we can have fast access to keyboards and joysticks.  Getting closer to the next update now.


declare import,timeGetTime(),int;

global sub main()
{
C3DScreen s;
C3DCamera c;
C3DMesh m;
C3DObject scene;
C3DLight light;
CDirectInput di;
float fadjust,fTarget;
//target 60FPS for camera movement
fTarget = 1.0f / /*FPS*/60.0f * 1000.0f;
fAdjust = 1.0f;

s.CreateWindowed(0,0,640,480,AWS_CAPTION|AWS_VISIBLE|AWS_SIZE,0,"3D Test - ESC exits",NULL,false);
di.Init(s);
s.CenterWindow();
c.Create(s);
c.Position(0,0,-150);
c.Orient(0,0,1,0,1,0);
c.SetBackPlane(500);

m.Load3DS(s,GetStartPath() + "media\defiant.3ds",true);
m.Scale(.2,.2,.2);
m.Position(0,-20,0);
m.Rotate(-22.5 * .01745,180 * .01745,0);
m.EnableLighting(true);
m.UseVertexColor(false);

light.Create(s,LIGHT_POINT,1);
light.Position(0,20,-150);
light.SetAttenuation(0,1/50.0,0);
light.SetSpecular(.5,.5,.5,1);
light.SetAmbient(.3,.3,.3,1);

scene.CreateScene(s);
scene.AddChild(light);
scene.AddChild(m);
int fps = 0;
int startTime;
do
{
startTime = timeGetTime();
//check for keys and move camera accordingly
IF di.KeyDown(DIK_UP)
c.Move(0.0f,.25f * fAdjust);
IF di.KeyDown(DIK_DOWN)
c.Move(0.0f,-.25f * fAdjust);
IF di.KeyDown(DIK_RIGHT)
c.Rotate(1*.01745 * fAdjust,0,0);
IF di.KeyDown(DIK_LEFT)
c.Rotate(-1*.01745 * fAdjust,0,0);
IF di.KeyDown(DIK_Z)
c.Rotate(0,0,-1 *.01745 * fAdjust);
IF di.KeyDown(DIK_X)
c.Rotate(0,0,1 *.01745 * fAdjust);
IF di.KeyDown(DIK_PRIOR)
c.Rotate(0,-1 *.01745 * fAdjust,0);
IF di.KeyDown(DIK_NEXT)
c.Rotate(0,1 *.01745 * fAdjust,0);
IF di.KeyDown(DIK_R)
c.LookAt(0,0,0);

s.Clear(RGBA(0,0,0,255));
s.BeginScene(c);
scene.Draw();
s.RenderText(0,10,"FPS:"+NumToStr(fps),RGBA(255,255,0,255));
fps = s.RenderScene();
fAdjust = (timeGetTime() - startTime) / fTarget;
}until di.KeyDown(DIK_ESCAPE);
Scene.Free();
}
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 17, 2006, 01:40:37 AM
Landscape (terrain) object at work.
Title: Re: Aurora's 3D engine
Post by: Kale on July 17, 2006, 02:07:17 AM
Impressive stuff! :)

How are collisions going to be handled within Aurora's 3D engine? and will a physics engine such as ODE be included too?
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 17, 2006, 02:14:53 AM
Aurora uses opcode for mesh to mesh collisions.  Sphere and Ray are also available.

Haven't looked into a physics just yet ;)
Title: Re: Aurora's 3D engine
Post by: Kale on July 17, 2006, 02:58:15 AM
Quote from: Paul Turley on July 17, 2006, 02:14:53 AM
Aurora uses opcode for mesh to mesh collisions.ÂÃ,  Sphere and Ray are also available.

Haven't looked into a physics just yet ;)

Very nice.

I'm definately planing to buy Aurora in the coming week. Once my book is finished (grammar checking last chapter) i will have more time to play. :)
Title: Re: Aurora's 3D engine
Post by: Barney on July 17, 2006, 05:13:11 AM
Physics can wait until the 3D stuff is stable and full featured. I would prefer Ageia as it can use specialised hardware to accelerate all physics calculation. If hardware is absent software calculations will be used automatically.

Barney
Title: Re: Aurora's 3D engine
Post by: Steven Picard on July 17, 2006, 07:57:53 AM
Quote from: Paul Turley on July 17, 2006, 02:14:53 AM
Aurora uses opcode for mesh to mesh collisions.ÂÃ,  Sphere and Ray are also available.

Haven't looked into a physics just yet ;)
Absolutely amazing work so far!!

I would love to see physics included along with rag doll technology like 3DImpact.  ;D
Title: Re: Aurora's 3D engine
Post by: Kale on July 17, 2006, 08:08:58 AM
Quote from: Barney on July 17, 2006, 05:13:11 AM
Physics can wait until the 3D stuff is stable and full featured. I would prefer Ageia as it can use specialised hardware to accelerate all physics calculation. If hardware is absent software calculations will be used automatically.

Barney

The only trouble with supporting such new technology as the Ageia system, is that nobody has these cards yet and it may also be rendered obsolete overnight by Havok's new version 4 engine which utilizes the users current GPU for acceleration. Who knows.ÂÃ,  ;)
Title: Re: Aurora's 3D engine
Post by: Shannara on July 17, 2006, 02:06:42 PM
Heh, I must be one of those people who prefer to keep subsystems in their respective components, etc. Thus I would love to see all physics using their PPU, while graphic cards use their GPU, and Sound cards SPU, and all else (am I missing something?), goes to the CPU..

Which reminds me ... DirectX10 or 11 comes with DirectPhysics .... .. :)
Title: Re: Aurora's 3D engine
Post by: Kale on July 17, 2006, 03:41:45 PM
Quote from: Sync on July 17, 2006, 02:06:42 PM
Thus I would love to see all physics using their PPU, while graphic cards use their GPU, and Sound cards SPU, and all else (am I missing something?), goes to the CPU..

Agreed, me too. But it depends how it's marketed to users (especially gamers). For example, would users prefer to keep their existing PC intact and have physics accelerated using their installed GPU? Or, be made to buy another card that will out perform the GPU when it comes to physics calculations but only if apps support it?

The Aegia PhysX card has impressive benchmarks, but will it take hold?

Betamax Vs VHS anyone?  ;)

The future will tell...
Title: Re: Aurora's 3D engine
Post by: Shannara on July 17, 2006, 05:13:37 PM
That ... is an excellent observation ... all in marketing .. For gamers, I would assume (ack!) that they would want the physics on the graphics card. That way, only buy one card and your good to go. Plus now that motherboards have less slots, board real estate is a major concern.

But for 3d modellers such as those who use Maya or 3ds max .. would probably want it on a seperate card (if the software supports it), to help cut down on some of the physics calculations.

I agree with you, depending on how it's marketed.
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 17, 2006, 09:07:07 PM
The main thing is to get 3d capabilities. Basic physics can be programmed in and not that much of a concern. As one of you wrote earlier, most of us are going to write stuff to play ourselves or sell as an indie game, not out there to compete with the top games at major retailers.

I was wondering what the engine would support for models. I did tests with darkbasic pro as it supports x format and 3ds. I was able to do more with the x format than with 3ds, but of course 3ds is supported by almost all modeling packages without any additional plugins required, where as you need to get x format plugins for many of the top modeling programs.

When I made levels for unreal 2004 it was nice that it supported lightwave objects directly with no conversion. But newtek doesn't seem to care about the gaming industry that much it seems if you read the posts in their forums. The new serious sam 2 engine also supports lightwave directly from what I read, but have not tried out yet.

I was playing with 3d max and the panda exporter plugin and so far that seems to work really well.

But I find that max and lightwave are overkill and cost so much for indie game makers.

I was thinking of trying caligai's stuff as they seem so reasonably priced and gamespace seems to be made just for modeling things for games and supports so many of the common file types.
I had bought and used a very early version of truespace and it was lots of fun and very elegant interface. From the free videos on the site it looks like they are at the cutting edge still in terms of interface.

I don't know but maybe someone could start a thread about modeling as if we have 3d programming capabilities, being able to model and put stuff in our developments will be a key part.
I have no idea what opengl supports in terms of model formats for instance. Or what is used on that end. Maybe someone who knows more about this stuff as well as the programming part with Aurora could start out such a thread the right way.

I am really excited that Paul is going to get us something to play with 3d soon that is for sure!!
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 17, 2006, 10:15:03 PM
Currently there are loaders for .3ds, .x, skinned x, and MD2.  I do have code for MD3 to convert and code for supporting bsp.

Plus all of the primitive commands for creating basic and custom shapes directly.
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 17, 2006, 11:03:06 PM
That's great Paul, thanks!!!
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 24, 2006, 05:39:35 PM
For the next update we'll have a 3D sprite class to play with too.  Still working out collision testing and such but it's nice to have hardware accelerated alpha modes.
Title: Re: Aurora's 3D engine
Post by: Kale on July 25, 2006, 03:15:14 AM
Very nice! I've just recently bought Aurora and im impressed already, even in Alpha! :o
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 25, 2006, 10:51:29 AM
Great to hear more cool things to look forward too!!
Title: Re: Aurora's 3D engine
Post by: J B Wood (Zumwalt) on July 26, 2006, 02:30:44 PM
Dea aurora masters  ::)

Little old me am making my first little old game in 3d with chicken scratch.
Ok, so here is me delima, per say..

I place 1 3ds object into the world at 0,0,0 and the terrain at 0,0,0 you would 'assume' the lower left corner of the terrain which is 0,0,0 in my editor would match my object, which is 0,0,0 in my editor.

But my little object is above the terrain.. way above the terrain.
I am using Gamespace 1.6 for this little old test of mine.

Tonight when I get home, my little old self will post little old pictures :)
Or maybe the app itself, I dunno yet, one or the other, maybe both..

Thank you for doing this little old 3d its ROCKING fun..
And yet sublimly simple.
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 26, 2006, 05:03:41 PM
Glad your having fun ;)

Perhaps Gamespace is offsetting the 3DS local coordinates?  I'd have to see the mesh to be sure.
Title: Re: Aurora's 3D engine
Post by: J B Wood (Zumwalt) on July 26, 2006, 07:30:55 PM
Here it is, what I have done so far, not much, but its playing around.
I have a shopping list of requests:

FromMemory options for everything that loads anything from the hard drive.
I want to clone objects into array's etc.
I know whats going on with the animation, you need to be able to start a mesh at key point and play through frames in the mesh file for each set of animation, etc. But THIS ROCKS

You have given me hope beyond hope for a 3d engine with the single basic release, you have no clue how happy I am!
You were well worth investing in!
Title: Re: Aurora's 3D engine
Post by: Zen on July 26, 2006, 07:38:47 PM
Zumwalt, You are right, Aurora is well worth the investment, Since i have used it i have had nothing but fun whenever i come on the forums i get all excited when the "Updates and Announcements" icon is purple in the hope of new features or classes to play around with.

Your starting off good, i like the model you have in there, although some lighting needs to be added to see it from all sides, but i am sure you will get there. Unfortunatley i am no 3D expert, so i need to learn a lot about that too.

Nice example
Lewis
Title: Re: Aurora's 3D engine
Post by: J B Wood (Zumwalt) on July 26, 2006, 07:56:08 PM
I generated the basic terrain in T.Ed, very basic, then I imported it into Gamespace 1.6, then I saved it as a 3DS file.
Second item is the robot, I cheated, I used a mesh I purchased for it, but it was there to prove the multi-tierd mesh with multiple textures and alpha's.
Soon as we get the coordinate system ironed out, I will create another map with an army of a multitude of creatures ranging for animals to humanoids, through machines all initially static to see what I can populate the world with and how much memory it eats.

But this truely is fun!
I want to become a affiliate!
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 26, 2006, 08:22:21 PM
Zumwalt, nice. The guy who made that mech is really great at making those. I remember when I bought an early version of truespace I had also bought a book on it and he had some great animations of his mechs in there. I do know that on that model, the canopy for the cockpit should have glass panels. What I did was extracted the glass from the rest of the mech. Basically deleting anything that wasn't part of the glass and then saved the glass as a separate object. Then reload the mech and delete the areas where the glass is and save it as another name for just the mech. THen you bring in both objects, under aurora the glass would be a child of the mech body. Then you have separate control of its transparency and such, and since it is a child it will move with the mech body.

As far as the terrain, in gamespace(not sure, as haven't used it)  you should be able to make a subdivided plane (that is a plane with lots of faces or segments) and then add a displacement map to it that would give you a nice terrain. The more faces/segments the smoother your terrain will be, but of course your poly count will go up and effect any game also. THen you wouldn't have to import and export. Does Truespace allow you to paint directly on the model as Truespace does? Then you could really give some nice textures to your terrain.

I am glad you got gamespace as i am thinking of either getting the latest truespace or gamespace and gamespace sure would save some bucks. I wrote to Caligari and they said Truespace is their flagship product and allows you to do more and gamespace was more for use in games and well, like I sort of knew that, but they sort of skirted around my questions so that is why I hadn't made up my mind. It will be interesting to see what you come up with and if you see any limitations.

Yep if you looked at Paul's latest demo example it is really easy to see the power in Aurora all ready.
Title: Re: Aurora's 3D engine
Post by: J B Wood (Zumwalt) on July 27, 2006, 09:06:55 AM
I am a beta tester for Caligari's Truespace line. There latest build if phenonimal, but very unique.
Its a memory hog, has some caveots, can't show you what I have installed or I would, I am under NDA.
The images here are from the 1.6 Gamespace.
The issue I alwasy had was exporting from Truespace 6 (which I own), it didn't have all the export options I wanted that Gamespace did for games.
I purchased one of there components for Truspace to give it the same exports, frankly even though I installed it after paying $99 for it, I have never used it.

Truespace 7.5 has a very strong scripting engine, and very confusing at the moment.
Gamespace 1.6 does everything currently I need for games, and the price is reasonable.
For anyone new to 3d and are broke, I suggest Blender http://www.blender.org/cms/Home.2.0.html
Its free and should work with Aurora, just haven't tried it yet with Aurora
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 28, 2006, 04:44:04 PM
A couple of questions.

1. Directx and Opengl are API's (application program interface), are all engines just simplifying access to those api commands or is that what a wrapper does?

2. If that is what a wrapper does, then how is an engine different than a wrapper?

3. What is the difference between a lib file that the 3d engine is going in too and a dll ?

4. Paul is everthing that you are developing in the 3d engine, since the windows version uses directx, will it eventually
cover all that directx has to offer?

5. So to get a head start, would it help someone to look through the directx api to get an idea of what sort of features they could expect and start planning future games and ideas?

Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on July 28, 2006, 05:11:24 PM
#1. No.  DiirectX and OpenGL are API's which provide an interface to the graphics card.  It is up to the engine creator to add all the good stuff like collision detecting, file loading, scene management, physics, particle generation etc.

A wrapper is just glue code to allow one language to use code written for another. 

#2.  Already answered.

#3.  Don't know how many times I've explained this over the years, this will probably be time 100 ;).  There are two types of .lib files when using Aurora, or C for that matter.  An import library and a static (linker) library. 

An import library contains offsets (addresses) of functions in a DLL.  They are a pair in other words.  If you have a dll named "coolstuff.dll" then you'll need "coolstuff.lib" for the linker.  The linker looks in this library to resolve names.  That's what the "create import library" on the tools menu is for.  It opens a DLL, reads all of the function names, and creates the import library so your program can use that DLL.  So an import library doesn't contain code, just a list of names and addresses.

A DLL is a collection of compiled functions.  The code is reused by every application that uses it.  The functions do not get added to your executable, but are called by loading the DLL into your address space at runtime (hence the name dynamic link library) and that's why you need an import library. 

A static (linker) library is a collection of compiled functions. The linker looks in these libraries, and copies the code into your executable, so the code is not shared between executables but a separate copy of the function used is included.

Before you even get to asking.  Static libraries are useful because you don't have to include a DLL with your executable.  DLL's are useful if a lot of programs will be using the same functions.  Like the system kernel32.dll.  If it was a static library then every executable you create with any compiler would contain duplicate code.  Making them huge.

#4.  No, and No.  The 3D engine is probably at the 40% mark.

#5.  Directx uses COM.  So unless you have a good knowlege of it you'll probably end up confused.  All recent examples from Microsoft are for managed code, making it more confusing ;).

In the same line you have to realize that DirectX and OpenGL are just interfaces to the graphics card.  a lot of low level stuff there, like creating vertex and index buffers, shader compilers, etc.  But nothing that a typical new game programmer wants to deal with.  The directX interface does offer loading code for X meshes, but nothing more.  Things like loading 3DS, MD2, etc all had to be written from scratch.

If your into math then I say go for it.  For example to rotate an object you have to calculate it's matrix.  Most engines let you call a simple function like RotateObject or in our case C3DObject::Rotate(x,y,z).   Internally this is what the code looks like for the rotate method:


void CSceneNode::Rotate(float x,float y,float z)
{
D3DXMATRIX temp;
//zero out the current translation matrix
D3DXMatrixIdentity(&mTran);
//scale the mesh
mTran *= *D3DXMatrixScaling(&temp,m_flScaleX,m_flScaleY,m_flScaleZ);
//rotate by the correct amount;
D3DXQuaternionIdentity(&m_qOrientation);
D3DXQuaternionRotationYawPitchRoll(&m_qOrientation,y,x,z);

  D3DXMATRIX matOrientation ;
  D3DXMatrixRotationQuaternion ( & matOrientation , & m_qOrientation ) ;
  m_vXZAxis.x = matOrientation._11;
  m_vXZAxis.y = matOrientation._12;
  m_vXZAxis.z = matOrientation._13;
  m_vUp.x    = matOrientation._21;
  m_vUp.y    = matOrientation._22;
  m_vUp.z    = matOrientation._23;
  m_vDir.x   = matOrientation._31;
  m_vDir.y   = matOrientation._32;
  m_vDir.z   = matOrientation._33;

  m_vLookAt = m_vDir + m_vPosition;

  CalculateXZAxis();

mTran *= matOrientation;
//move the mesh to the correct world position;
mTran *= *D3DXMatrixTranslation(&temp,m_vPosition.x,m_vPosition.y,m_vPosition.z);
}


A bit more than a wrapper ;)
Title: Re: Aurora's 3D engine
Post by: kryton9 on July 28, 2006, 06:11:03 PM
Thanks, for the answers.

My confusion for wrappers all dates back to a few years ago when I picked up a book on writing games in c/c++. I then ran across the cdx wrappers. With that I was able to do some cool things and to me it felt as easy as an engine. So they might have called it a wrapper, but it obviously did more than that... and hence why all these years I have been confused.

In working on this game I started in DarkbasicPro this year, I realized getting into matrix math and working with vectors is a requirement in doing anything advanced. Like a target pointer in a H.U.D. to targets that could be in any direction in space in relation your position, up, down, behind and front etc.

And in looking at your frags example and the last example with the rotating spheres, the power of oop is easy to see, but hard to grasp at the moment, when writing code from scratch.

I can see why I am not the only once confused about lib files vrs dll's. Also in early paradox programming we compiled our scripts into useable functions that were stored in libraries or lib files and hence the confusion there as they were not tied to dlls.

ANyways thanks for your answers and clarifications!
Title: MD2 and pcx
Post by: kryton9 on August 05, 2006, 12:30:51 PM
Paul, I am working on adding md2 into my model viewer today. The md2 file I found has a pcx texture file.
When I try to load it, it says it can't load the texture. Is pcx format supported or do I need to convert it and if so, which format?
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on August 05, 2006, 12:32:58 PM
I'll have to look.  Whatever format DX supports is what can be loaded.

Title: Re: Aurora's 3D engine
Post by: kryton9 on August 05, 2006, 12:42:51 PM
I just converted it to a png and it took it, so it must not support pcx.
Title: Re: Aurora's 3D engine
Post by: kryton9 on August 22, 2006, 05:06:28 PM
Paul the new LookAt(x,y,z) and Light features sound exciting.

Here are some, what I would consider high priority to give lots of flexibility and capabilities:
1. ghosting and fading adjustments for meshes

2. being able to paint to memory(like loading a bmp, but we could actually paint to memory and then use it as a loaded bmp file, and apply that to objects as textures. This means can do lots of stuff without having to include images.
Also to add effects, like blur, flip, mirror and to be able to paste sections from one image to another in memory. Then to apply images to meshes as textures.

2a. something similar but a lot easier just to specify the object color.

3. PERFORM CHECKLIST FOR DISPLAY MODES : That is a way for use to issue a command and get a list of supported resolutions and depth that the user's card can support and then we can use those results to set the screensizes automatically.

This is not high priority, but very useful:
I wrote a function that does a wrapvalue, it wraps values less than 0 to 360 down and anything above 360 to 0 up, this would be nice to have as a built in fast routine. If it could do it for Rads and Degrees it would be neat. So WrapValueDeg(); and WrapValueRad(); It is nice to have the option to keep incremental values to figure out rotations, but many times it is nice to have the wrapvalues too. So having a separate WrapValues() commands would be nice.

Also, I know writing help is very time consuming, but maybe just a very short, no need to go in depth description, but just what they do one or 2 lines max. And an example of how you would call it, useing s as the screen, c as the camera, scene for a scene, m for a mesh, l for light. Seeing real values instead of just what the declaration is really helps make the point of what you need to send.

I see already lots of commands with Alpha and color, but have no clue what they do or will ever figure out.
Title: Re: Aurora's 3D engine
Post by: Ionic Wind Support Team on August 22, 2006, 05:35:26 PM
You can color a non textured mesh in two ways.

1. The vertex can specify a color, and a model editor usually has this option.  Or you can write the diffuse color of each vertex yourself as in the the custom_mesh.src example.  Lock the vertex buffer, loop through the vertices setting the diffuse color you want.

2. Use a material.  The world_local.src example shows this by coloring the moon red.  A material specifies the diffuse, specular, emissive and Ambient colors.  If you want just a solid color use the diffuse color of the material.  The emissive color allows the object to appear to 'emit' light, the light it emits is a visual thing and doesn't affect other objects, it's a nice effect for crystals and such.

Quote
2. being able to paint to memory

That is a bit more difficult.  I can do it for 3DSprites, and already have code ready for that.  But textures use a multiple LOD system (level of detail) so a loaded texture might be comprised of many images, not just one, and have filters applied to the levels.  So once it is loaded there isn't a one to one correspondance between a pixel and a texel.

You can save your texture in resources by the way.  Just add the texture to the resources of a project, and use the filename as the resource name, or pick a name of your chosing.  Not all image types work as a resource though.


Title: Re: Aurora's 3D engine
Post by: kryton9 on August 22, 2006, 05:50:45 PM
Thanks Paul, I know there is already a lot in Auroa, it is just knowing what they are and how to use them, but I know that is coming in good time. Thanks, great to know that a lot of what we want is in there.
Title: Re: Aurora's 3D engine
Post by: J B Wood (Zumwalt) on August 22, 2006, 06:58:34 PM
I am always wondering how to use resources in projects, never did figure that one out.