Page 4 of 4

Re: Atlus's .PB (3D model format)

Posted: Sat Jun 27, 2015 8:37 am
by Tosyk
TGE, nice progress on this, man. Looking forward to see the script :wink:

Re: Atlus's .PB (3D model format)

Posted: Sun Aug 09, 2015 11:16 pm
by TGE
I released the script
viewtopic.php?f=16&t=13159

Re: Atlus's .PB (3D model format)

Posted: Thu Apr 26, 2018 2:22 am
by prototypesky
prototypesky wrote:Ok I found the actual animation data from a RMD file
the structure of it so far is
the first 4 bytes is a float value
the next 4 bytes is the number of animation key frames

Each key frame is 22 bytes in size
The first four bytes of each key frame is a float value
where the values range from 0.0f to 2.0f
then it is followed by 14 bytes of data which I haven't been able to confirm what each byte represents but they affect the bone matrix orientation for that frame and the last 4 bytes seems to be either 2 shorts or an interger value.

I've noticed that the first n key frame data structures where n = the total number of bones defined in the model, the last 4 byte values are the same and the first 4 byte float values are = to 0.0f
Then the next n value the first 4 byte float values now range from 0.0f to 2.0f and the 4 byte integer at the end of the 22 byte data structure value increments in multiples of 24 e.g (0, 24, 48, 72, 96 etc up until n*24 value after which the numbers don't don't ascend always the amount 24 but a multiple of 24 sometimes. I am guessing the last four bytes determines which bone matrix is altered and when on the animation time line they are altered.

Also after all the key frame data structures there are 6 float values.

Anyone wishes to try and make sense of this format?
Ok solved it renderware had compressed floats

to uncompress
I = int(H & 0x8000) << 16
if H & 0x7fff:
I |= int(int(H & 0x7800) << 12) + 0x38000000
I |= int(H & 0x7ff) << 12

return I

to decompress the quaternion floats
then use the x,y,z offset vector and a x,y,z scale vector that follows the frame struct array that has to be applied to each decompressed position vectors for the proper value

Re: Atlus's .PB (3D model format)

Posted: Thu Apr 26, 2018 5:57 am
by killercracker
Have you tried dividing the frame data by 32767.0 or 65535.0?

Re: Atlus's .PB (3D model format)

Posted: Thu Apr 26, 2018 6:32 pm
by prototypesky
killercracker wrote:Have you tried dividing the frame data by 32767.0 or 65535.0?
yes it doesn't seem to be fixed point
the first four float should be an Quaternion identity of 0.0f, 0.0f, 0.0f, 1.0f
so the value 30720 should convert to 1.0f I believe

See previous post for solution.