April 26, 2024, 01:44:33 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Aurora's 3D engine

Started by Ionic Wind Support Team, July 12, 2006, 11:03:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ionic Wind Support Team

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.

Ionic Wind Support Team

Barney

Great news! :)

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

Barney

Zen


Ionic Wind Support Team

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.
Ionic Wind Support Team

kryton9

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 :)

Rock Ridge Farm (Larry)

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.

Ionic Wind Support Team

You have to wait for the update of course ;)
Ionic Wind Support Team

Rock Ridge Farm (Larry)

OK - Impatiently waiting.

Ionic Wind Support Team

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();
}

Ionic Wind Support Team

Rock Ridge Farm (Larry)

Now that is cool - How did you make the .3ds file?

Zen

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

Ionic Wind Support Team

Actually I downloaded the .3ds from trekmeshes. 
Ionic Wind Support Team

Barney

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

Ionic Wind Support Team

I'm a fan of all of the shows, not neceissarily a fanatic though ;).  The defiant was a cool ship, basically a flying weapon.

Ionic Wind Support Team

Kale

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

Zen

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

Zen

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

kryton9

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?

Ionic Wind Support Team

There is no DirectX on Linux natively.  It will have to be OpenGL.
Ionic Wind Support Team

Ionic Wind Support Team

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.
Ionic Wind Support Team

kryton9

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?

Ionic Wind Support Team

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.
Ionic Wind Support Team

Barney

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

Zen

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