Join also our Discord channel! Click here.

## Atlus's .PB (3D model format)

Post questions about game models here, or help out others!
Tosyk
double-veteran
Posts: 945
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 118 times
Contact:

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

TGE, nice progress on this, man. Looking forward to see the script
Thank you for all you do here
my blog | my forum

TGE
veteran
Posts: 109
Joined: Wed Jun 04, 2014 7:48 pm
Location: Netherlands
Has thanked: 20 times
Been thanked: 32 times
Contact:

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

I released the script
viewtopic.php?f=16&t=13159

prototypesky
beginner
Posts: 24
Joined: Mon Oct 06, 2008 10:10 pm
Has thanked: 2 times
Been thanked: 9 times

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

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
You do not have the required permissions to view the files attached to this post.
Last edited by prototypesky on Sat Apr 28, 2018 3:39 am, edited 1 time in total.

killercracker
Posts: 56
Joined: Sun Sep 25, 2011 11:31 pm
Has thanked: 6 times
Been thanked: 87 times

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

Have you tried dividing the frame data by 32767.0 or 65535.0?

prototypesky
beginner
Posts: 24
Joined: Mon Oct 06, 2008 10:10 pm
Has thanked: 2 times
Been thanked: 9 times

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

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.