XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Wed Oct 18, 2017 6:47 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: R2 Online models
PostPosted: Thu Feb 12, 2009 2:54 am 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times














You can make the ads go away by registering

Here's the correct goblin thingy from a few posts back. I had an error with loading the texture that was flipping the image. I noticed it on the in game image of the girl and found that I didin't need to flip it.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Thu Feb 12, 2009 3:54 am 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2433
Has thanked: 56 times
Have thanks: 1185 times
That looks much better you are doing a great job and a great speed also :)
If you want any more models i will post some for you and in game screens if needed.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Thu Feb 12, 2009 4:12 am 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
chrrox wrote:
That looks much better you are doing a great job and a great speed also :)
If you want any more models i will post some for you and in game screens if needed.


Thanks! I always thought these models were really nice looking. But I have all the 'character' models and textures extracted so I can view/test them all easily now; well except at work.

I also got alpha textures working so they'll look a bit nicer now.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Thu Feb 12, 2009 7:57 am 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Aug 11, 2008 11:30 pm
Posts: 421
Has thanked: 23 times
Have thanks: 13 times
impressive!


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Fri Feb 13, 2009 2:39 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Aug 11, 2008 11:30 pm
Posts: 421
Has thanked: 23 times
Have thanks: 13 times
I am updating this thread all the time, waiting for more info. A real cliffhanger :) R2 has very beautiful models. Hope to get models and animations later on to analyze them totally :)


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Fri Feb 13, 2009 5:16 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Ya, sorry I haven't been able to update it recently. I did try to play around with what I believe is the bone data for the model. By default, as many 3d models are, the given vertex data is in a standard pose; in the case of R2, they are in a standing with their arms slightly fanned out from the side. However my attempt was not successful and it really messed up the model lol.

So if anyone has any good links to any kind of helpful info please let me know. I will also update the model format for the "rmb" files. I'd say it's about 85% complete with the last 15% in the "I have no idea" or "I think it's formatted like this" category. So expect this sometime this weekend.

I will also release the code I have for viewing the models that I posted. It's built in C# (though it should be easily ported to C++ or other languages) and runs using OpenGL for it's graphics using sample code from NeHe Productions (http://nehe.gamedev.net/ which is a great site).

Hoping to have this by Saturday.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Sun Feb 15, 2009 2:07 pm 
Offline
veteran
User avatar

Joined: Sat Sep 13, 2008 3:13 pm
Posts: 92
Has thanked: 3 times
Have thanks: 12 times
Excellent, looking forward to it!


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Sun Feb 15, 2009 9:20 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Note that this applies to only RMB files.
Code:
DWORD itemFlag;
DWORD unknown[4];
DWORD textureCount;
DWORD meshCount;
DWORD boneCount;
DWORD dataOffset;

struct string {
  char filename[260];
} textures [textureCount];

struct mesh {
  DWORD index; // 0?
  DWORD unknown1; // -1?
  char meshName[64]; / name of mesh
  char parent[64]; // name of parent bone
  DWORD extraFlag;
  DWORD unknown2; // 1?
  DWORD vertexCount; // number of vertices
  DWORD indexCount; // number of indices

  //no idea what the next 2000 bytes are, so just skip it, sure it's relevant somehow...
  byte data[2000];
} meshes[meshCount];

// next area is the bone information which I left I work...though it's still mostly incomplete, will add this in tomorrow
// for now, can skip to the dataOffset location
struct meshData {
  floatx3 pos[meshes[index].vertexCount];
  floatx3 nomral[meshes[index].vertexCount];
  floatx2 uv[meshes[index].vertexCount];
  floatx3 unknown1[meshes[index].vertexCount];
  floatx3 unknown2[meshes[index].vertexCount];
  if (mesh[index].extraFlag == 1) {
    floatx4 boneWeights[meshes[index].vertexCount];
    WORDx4 boneMatrixIndex[meshes[index].vertexCount];
  }
  WORD indices[meshes[index].indexCount];
} meshData[meshCount];



That's basically it...rather messy I know but it's enough to display/render the mesh in it's default pose. When reading the mesh data it's laid out like so:
positional data (3 floats x,y,z)
vertex normal data (3 floats nx,ny,nz)
texture coords (2 floats u,v)
unknown data (3 floats)
unknown data (3 floats)
*It's possible that this could be some kind of translational or rotational values.
if (extraFlag == 1)
bone weight data (4 floats x,y,z,w)
bone matrix data (4 WORD values)
end if


I'm off to do some rock climbing so I will post my source later today.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Sun Feb 15, 2009 9:44 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2433
Has thanked: 56 times
Have thanks: 1185 times
Very nice work i look forward to playing around with the source code.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 16, 2009 8:49 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
OK! Here's the C# project I've been using to render the loaded meshes. It's fairly simple to use. It runs on OpenGL so make sure you have that which most should. The project is a Visual Visual C# Express 2008 (express editions are free to download from Microsoft's website) project but can/should be easily converted to different languages/versions.

The majority of the code is in the TestGL.cs file and the important methods are:
readRMB (loads the rmb file)
loadImage (loads the dds files and generates the OpenGL textures for them)
loaded (called when the form is done loading, which is after the rmb file is loaded, so that it knows when to load the textures)
OnPaint (does the rendering)

the "readRMB" method has the filename hard coded into it like so:
Code:
        const string path = "C:\\models\\";
        private void readRMB() {
            string meshFile = path + "p070000.rmb";
            ...
        }

This line just points to the location of the extracted rmb files
Code:
const string path = "C:\\models\\";

And it assumes that the extracted textures are located a directory inside this folder and is named "texture"
So the full path to the rmb file would be as such:
Code:
C:\\models\\p070000.rmb

And the texture folder would be:
Code:
C:\\models\\texture\\

Not very elegant but it works. Ideally the code should work smarter but I just kept it like this because I was lazy and it was easy :P

If anyone wishes to expand on what I got and make the animations/skinning work, by all means do so. I have limited knowledge on that subject but I'm gonna research it a bit more and update if necessary.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 16, 2009 10:13 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2433
Has thanked: 56 times
Have thanks: 1185 times
Very nice work works great. I will try to implement a drag and drop method for loading the files and if i can figure it out hopefully a way to control the camera with the mouse.


Last edited by chrrox on Mon Feb 16, 2009 11:50 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 16, 2009 11:19 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Aug 11, 2008 11:30 pm
Posts: 421
Has thanked: 23 times
Have thanks: 13 times
great work! Alot of thumbs up and star ratings for you. Let's hope someone with skills can pick this up and expand


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Tue Feb 17, 2009 3:13 am 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2433
Has thanked: 56 times
Have thanks: 1185 times
I found a c# tutorial for loading animations from milk shape 3d files which could be applied here as it is just a different file format.
http://www.sichbo.ca/Free_Code/Milkshap ... and_OpenGL

I almost got drag and drop working but it does not load the textures ill figure it out.
edit "doh i think I will get this working soon i am a fool lol"


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Thu Feb 19, 2009 5:20 pm 
Offline
mega-veteran
mega-veteran

Joined: Thu Dec 07, 2006 11:25 pm
Posts: 280
Has thanked: 5 times
Have thanks: 52 times
Today I released the 3D Object Converter v4.221 update at 17:10.

You can update your installed application (version>=4.0) quickly and easily using the auto-update function (Help/Check for updates).


My program currently supports 8 different uncompressed types of the DirectDraw Surface *.dds texture format. The R2: Reign of Revolution uses the compressed .dds format.

When I wrote and tested my .rmb loader module I used the following procedure to get the texture shaded view (in my program):

- Convert the .dds files into .jpg files using the Irfanview's batch converter module.
- Run the 3D O.C.
- Check out the Options/Import/Default texture file extension (.jpg)
- Turn on the 'Options/Import/Set the default texture file extension in the material table after load'
(This will replace the .dds file extension to .jpg automatically after load your object)

(Or you can use the 'Tools/Set the default texture file extension in the material table after every load if you would like...)

- Save settings.
- Apply settings.
- Load the .rmb file.


http://web.t-online.hu/karpo


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Fri Feb 20, 2009 5:20 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Very nice.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group