Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Help understanding DBO file format, and how it relates to objects in DBP?

Author
Message
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 30th Sep 2011 03:19
Hi all!

I was reading through the file on DBOs supplied with DBPro in the documents section of the help, and I'm a bit confused about the structure of the file.

I mean, it goes into the header, and then it goes into "Data Blocks", then the root frame after the header.

How is the root frame organized, and where does the data for the 3D model lie? Is it necessary to have a bone structure for your 3D object? Also, how is animation handled with it?

Then the next big question... How does the DBO file format relate to DBP objects? Is it the same format in memory?

If anyone could show the layout with maybe an explanation with a cube or something simple (maybe even a single triangle), that would be extremely helpful.

Thanks!
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 30th Sep 2011 09:26
Nevermind, I think I got it... I'm going through a hex editor and reading it all.

Tomorrow I'll post more info regarding how it works, and how to implement animation (or my take on it, anyways).
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Sep 2011 14:29 Edited at: 30th Sep 2011 14:30
All the code to load and save .dbo files is open source btw

[b]
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 30th Sep 2011 19:58 Edited at: 30th Sep 2011 20:00
Well, this all makes sense. I've even read through the source code, and I'm following the right pattern.

The only thing I don't understand at this point is:

Type Size Information
DWORD 4 Time
float [ 3 ] 12 Position
float [ 3 ] 12 Interpolation

What is Time and Interpolation? I am guessing Position is the new position vector of the object. My best guess for Time is when this transformation occurs. Interpolation is probably at what rate does this transformation occur.

EDIT: Also, what is Matrix data, if anyone knows?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Sep 2011 20:11
What type of data is that? The bone animation stuff?

Anyway, I'd suggest that you load an MD2 file (that animates in the way you are planning to), then get DBPro to save it out as a DBO, and then check out the content of that data against the file spec.

To make it a little easier, I posted code into the DGK forum that would allow you to load a model, and dump it out in text format. It's based on the original 'save' code and is therefore under the Apache license.

Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 30th Sep 2011 20:19 Edited at: 30th Sep 2011 20:19
Thanks I'm going to check that out right now! And no, that's actually animation data.

One other thing I think I should ask... do you need a animation subblock for each frame, or can you have one that spans over a given set of frames?
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 30th Sep 2011 20:44
Well, I tried hardcoding animation data into the OBJ file using a memblock, however that doesn't work since ADD MEMBLOCK TO OBJECT only does it for an "extra data" feature and doesn't necessarily allow you to add subblocks to the object.

Here was the code:




So now the next thing I'll do is load up each frame as an individual limb and then hide/show limbs per each frame and see how well that works.
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 30th Sep 2011 21:58
I'll just interpose randomly here with - "one of these day someone will release a plugin to export DBO objects in DirectX .x file format or maybe .3ds format - but retaining in that format limb, texture, animation data etc - and on that day the author of such a useful plugin would make a wonga of money..."

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 1st Oct 2011 02:10
Quote: "export DBO objects in DirectX .x file format or maybe .3ds format"
Its not quite as nice as a plugin, but Fragmotion can do that.
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 1st Oct 2011 10:23
@ revenant chaos,

Had a look at Fragmotion a couple of years ago - do you know if it is truly compatible with the latest version of the .dbo file format?

p.s. thx and agree 'not quite as nice as a plugin'. I still live in hope that RonE will finish 3D Character Maker.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...

Login to post a reply

Server time is: 2026-07-10 10:41:53
Your offset time is: 2026-07-10 10:41:53