March 28, 2024, 08:21:44 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


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.

J B Wood (Zumwalt)

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

kryton9

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?


Ionic Wind Support Team

July 28, 2006, 05:11:24 PM #52 Last Edit: July 28, 2006, 05:14:28 PM by Paul Turley
#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 ;)
Ionic Wind Support Team

kryton9

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!

kryton9

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?

Ionic Wind Support Team

I'll have to look.  Whatever format DX supports is what can be loaded.

Ionic Wind Support Team

kryton9

I just converted it to a png and it took it, so it must not support pcx.

kryton9

August 22, 2006, 05:06:28 PM #57 Last Edit: August 22, 2006, 05:19:04 PM by kryton9
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.

Ionic Wind Support Team

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.


Ionic Wind Support Team

kryton9

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.

J B Wood (Zumwalt)

I am always wondering how to use resources in projects, never did figure that one out.