Monday, September 20, 2010

Simple Flash Game :-)

Now I develop some simple game on Action Script 3.0 like as Digger. This is sample :

 

Monday, April 5, 2010

m3_viewer Star Craft 2 fast update 0.0.3a.

Fast update : change screen size to 800*600 px.;
                    font changed to Times New Roman;
                    fixed UI blending.

Download : m3_viewer.zip


Sunday, April 4, 2010

m3_viewer Star Craft 2 has updated to 0.0.3.

m3_Viewer has updated to 0.0.3 version. In the new release :

a ) meshes and textures are loading in the second thread ( in background ) parallel with main thread. Now you can see more meshes for one execute;
b ) added simple user interface for convenience :-);
c ) fixed bug with normal calculate ( if you will enable lighting, you will see this);

 Download : m3_Viewer.zip

Screenshots :

Monday, March 8, 2010

m3_viewer Star Craft 2 build 0.02.

m3_viewer has updated. download_link
In this release :
          - convert to .obj file;
          - normal show turn on\off;
          - light turn on\off.
 

  

 

.gEngine with .m3 model

I post screenshots from my game engine "gEngine". I develop it 1.5 year. GAPI is DirectX 9.0. 

Development :
       Scene:
            Chancked terrain ( realtime preload in second thread);
            StaticMeshes;
            DynamicMeshes ( only morph animation);
            SkyDome ( atmospheric scattering);
            WaterPlane ( reflection );
            Dynamic Grass;
            LevelManager ( manage level resource for instancing render );
            ResourceService : ( services for managing game resources );
                              ShaderService;
                              TexturesService;
                              StaticModelService;
                              DynamicModelService;
                              MapChankPreloadService;
       FileFomat's :
            .md2 ( Quake 2 morph animation );
            .m2   ( World of Warcraft static models );
            .m3   ( Star Craft 2 static models );
       Shaders :
            Lighting ( diffuse, specular, self shadowing);
            Parallax Mapping ( static models, terrain );
           
Atmospheric Scattering ( for SkyDome );
            Reflection Mapping ( for water plane );
            Shadow Mapping ( only for terrain );
            Post Effect Bloom;

Some screenshots from gEngine:








m3_viewer Star Craft 2 build 0.01.

I upload some tool to view .m3 mesh. I'll plan add converter to .obj file format. You can download binary file's from download_link .

struct M3VertexBlock
{
    D3DXVECTOR3 position;
    short value[12]; // array of unknown values. I try cast it's to normal and texture coordinates, but does't work. 6,7 - are texture coordinates /2048.
};

struct M3Header
{
        char id[4];// id for file format.
        uint32 tagsOffset;// offset to array of the tags.
        uint32 nTags;// number of tags.
        uint32 unknownValue_01;
        uint32 unknownValue_02;
};

struct M3Tag
{
        char tagName[4];// name ot the current tag.
        uint32 blockOffset;// offset reference to the block with some data.
        uint32 blockSize; //  count of the block.
        uint32 version;
};

void ReadFile(char* name)
{
         char *fileData;

         ifstream inStream;
         inStream.open(name,ios::in | ios::binary);
         inStream.seekg (0, std::ios::end);
         int fileSize = inStream.tellg();
         inStream.seekg (0, std::ios::beg);
         fileData= new char[fileSize];
         inStream.read(fileData,fileSize);
         inStream.close();

         M3Header headed;
         memcpy(&header, fileData, sizeof(M3Header));

         tags = (M3Tag *)(fileData+ header.tagsOffset);

         M3VertexBlock* vertexBlock;
         unsigned int nVertecesM3 = 0;
         unsigned int nIndicesM3 = 0;
         unsigned short * indexBlock;
         bool firstIndexTag = false;

         for(int i = 0; i < header.nTags; ++i)
        {
                if( tags[i].tagName[2] == '8') && (tags[i].tagName[3] == 'U') // __8U - reference to vertex data.
               {
                      nVertecesM3 = (tags[i].blockSize)/sizeof(M3VertexBlock);
                      vertexBlock= (M3VertexBlock*)(fileData+ tags[i].blockOffset);
               }

               if((tags[i].tagName[1] == '6') && (tags[i].tagName[2] == '1') && (tags[i].tagName[3] == 'U'))  // _61U - reference to index data.
              {
                    if(firstIndexTag) continue;
                    firstIndexTag = true;
                    nIndicesM3 = tags[i].blockSize;
                    indexBlock = (short*)(fileData+ tags[i].blockOffset);
             }
      }
}