Page 4 of 8

Re: Heroes of Might and Magic 6

Posted: Sat Apr 07, 2012 5:21 am
by finale00

Re: Heroes of Might and Magic 6

Posted: Sat Apr 07, 2012 2:47 pm
by Demonsangel
Karpati wrote:Demonsangel,

If you would you like, I can share the way how can I get the correct bone positions...
Seeing as how they don't seem to be in rad either, yes please. :D

Edit: I only now realised you're the creator of 3d Object Converter. (:

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 3:29 pm
by Demonsangel
Script updated for Emissive materials.

Todo:
fix bones
animations
normals
revert back to pre- rapi.imm code

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 4:01 pm
by finale00
Hmm, seeing your imm code makes me want to go try it out again, since you got it work and all lol

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 4:06 pm
by Demonsangel
finale00 wrote:Hmm, seeing your imm code makes me want to go try it out again, since you got it work and all lol
It might just be me but it seems as if the imm code is 10-20 times slower than the rapi.rpgBind .

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 4:16 pm
by finale00
Having to construct the buffers by taking the existing buffers and making it per-vert might also take up some time.
I'd prefer some C++ code take in some per-face buffers and convert it to per-vertex buffers though if they don't already exist!

But, 10-20x lol I didn't think python overhead would be that big.

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 4:25 pm
by Demonsangel
Yeah, but the only reason I was doing it was because, when I was messing with the emissive materials, I swapped from bindUV2 to immLMUV and I rewrote my script during that time so I rewrote it completely to imm.

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 4:32 pm
by finale00
Oh I just realized you were using the new imm API that was added recently.
Gotta try that out lol

EDIT: oh, it looks like there's no bindLMUV function...

I think if you re-factored the create_model function you might be able to get more out of it. The triple for-loop would likely bog you down.

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 4:43 pm
by Demonsangel
finale00 wrote:Oh I just realized you were using the new imm API that was added recently.
Gotta try that out lol

EDIT: oh, it looks like there's no bindLMUV function...

I think if you re-factored the create_model function you might be able to get more out of it. The triple for-loop would likely bog you down.
Use "rpgBindUV2Buffer" for LMUV.

Those loops will vanish when I go back to the old method.

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 8:28 pm
by Antonkf
The updated script generates an error in Noesis. I tried to open the same Sarah that the previous version of the script opened normally.

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 8:49 pm
by Karpati
Demonsangel wrote:Seeing as how they don't seem to be in rad either, yes please. :D
Edit: I only now realised you're the creator of 3d Object Converter. (:
I returned to my home now.

The missing information:

10 bytes (unknown)
3x4 floats (X,Y,Z positions)
3x4 floats (scale factors ?; usually about 1.0; I don't use these values)
4x4 floats (Quarternion X,Y,Z,W values)
25 bytes (unknown)

Re: Heroes of Might and Magic 6

Posted: Thu Apr 12, 2012 9:50 pm
by Demonsangel
Antonkf wrote:The updated script generates an error in Noesis. I tried to open the same Sarah that the previous version of the script opened normally.
What error? The script runs fine for me.
Make sure your Noesis is up to date, there was a minor bugfix which was needed for the emissive materials.

@Karpati, ty I'll try it that way.

Re: Heroes of Might and Magic 6

Posted: Fri Apr 13, 2012 9:38 am
by Antonkf
Looks cool! Thanks for the explanation. With updated Noesis works fine :)

Re: Heroes of Might and Magic 6

Posted: Fri Apr 13, 2012 7:10 pm
by Demonsangel
Karpati wrote:
Demonsangel wrote:Seeing as how they don't seem to be in rad either, yes please. :D
Edit: I only now realised you're the creator of 3d Object Converter. (:
I returned to my home now.

The missing information:

10 bytes (unknown)
3x4 floats (X,Y,Z positions)
3x4 floats (scale factors ?; usually about 1.0; I don't use these values)
4x4 floats (Quarternion X,Y,Z,W values)
25 bytes (unknown)
How are you parenting your bones?
You are using the data which I first thought to be bonedata (I'm assuming this because of the extra 25 unknown bytes) but I couldn't find any parenting data for them and using these as absolute offsets didn't work either.
Atleast with the data I was using before I achieved something that looked like an armature.

I assume with 3x4 floats you mean 3 floats (length 4 bytes)

This is with first 3 floats = x,y,z
ignore next 3 floats
4 floats = noeQuat(x,y,z,w)
no parenting, absolute offsets
Image

Re: Heroes of Might and Magic 6

Posted: Fri Apr 13, 2012 9:42 pm
by Karpati
You have right, when I wrote these lines I was tired.

The correct datas are the followings:

10 bytes (unknown)
3x4 bytes floats (X,Y,Z positions)
3x4 bytes floats (scale factors ?; usually about 1.0; I don't use these values)
4x4 bytes floats (Quarternion X,Y,Z,W values)
25 bytes (unknown)


I did not find the parent information yet.

I used the following procedure to get the bone position:

- I did put the X,Y,Z positions to Matrix_1
- I 'converted' the Quarternion X,Y,Z,W values to Matrix_2
- Bone matrix=MatrixMultiply(Matrix_1,Matrix_2)
- I ripped the X,Y,Z positions from the Bone matrix and multiplied these values by '-1'