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 / How to get access to individual 3D objects within a loaded .DBO file ?

Author
Message
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Dec 2012 21:49
Hello,

Is it possible to iterate through the individual 3D objects that are part or constitute a loaded .DBO file and get access to each one of them ( so that they can be manipulated ) ?

If so how ?

Thanks,
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Dec 2012 22:05
They are most likely limbs. Look into:



TheComet

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Dec 2012 22:11
@TheComet: So if I have 3 individual animated characters (.x) in .DBO file , they are just limbs ?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Dec 2012 22:30
Have a look at MAKE OBJECT FROM LIMB...

It would help if you could explain what it is you wanted to achieve

If possible a screenshot of said model to illustrate

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Dec 2012 22:40
Suppose I have 3 cubes positioned over a plane ( all .x files ) and they are saved at run time as .DBO file. Now when I load the .DBO file again at run-time I want to get access to each one of those 3D models - 3 cubes and 1 plane so that I can manipulate their properties - position, size, colour, texture, effects etc. at run-time.

The scenario can be more complex like having 3 animated models ( instead of cubes ) or static complex 3D objects that is made up of many smaller 3D objects. I need to have access to each smaller parts that make up each of those complex 3D objects - so that I can change
their properties at run-time.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Dec 2012 23:54
Why save them to one file and not 3 separate files? It complicates things, because you're pretty much fusing the 3 objects together to be one.

TheComet

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Dec 2012 00:42
@Juggernaut
If you have just one object containing the whole animation like in a group...in that case you have to do what TheComet said...just playing with limbs.


Cheers.

I'm not a grumpy grandpa
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Dec 2012 09:35
Quote: "Why save them to one file and not 3 separate files? It complicates things, because you're pretty much fusing the 3 objects together to be one.

TheComet"


When the player saves the game level in middle of playing - saving the whole scene as .DBO seems to be easiest path available. So when the saved scene is loaded back again in memory, I will have to iterate through the individual objects in the .DBO file and get acccess to each of them in case I want to manipulate their position, orientation, texture, effects etc. So I was wondering how to do all this.
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 22nd Dec 2012 13:13
Quote: "When the player saves the game level in middle of playing - saving the whole scene as .DBO seems to be easiest path available."

to save the whole scene as a single .dbo object every object will have to be added to a scene object as a limb. To add object as a limb of anither it needs to be converted to mesh. When you convert object to mesg you lose all texture and animation data so this method won't work for objects with multiple materials and animated objects.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Dec 2012 13:22
So why does .dbo file format exist at all ?
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 22nd Dec 2012 14:14
.dbo format is very close to the format that object data has in memory and because of this it's faster to load. Also it is dbpro's own format so it can contain object data relevant to dbpro. Other object formats usualy contain only some of the basic object data such as textures, vertices and indices. Dbo format contains much more.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Dec 2012 14:22
Does DBO format contain material (shader) data and lightmaps ?
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 22nd Dec 2012 14:30
Quote: "Does DBO format contain material (shader) data and lightmaps ? "

yes

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Dec 2012 17:03
But there is no proper function to iterate through individual parts ( objects ) present within a .DBO file ?

So when I design a whole level in DeleD and export it as .DBO file , I do not get access to individual 3D models that make up the level through code for manipulation at run-time ?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Dec 2012 17:11 Edited at: 22nd Dec 2012 17:12
Yes you can, through limbs. As I said, check into the commands I posted in my first post. Off the top of my head, this will give you access:



TheComet

Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 22nd Dec 2012 18:55
Try this utility that I made for myself in order to inspect object limbs (it will work with .x and .dbo)
cheers
Once exe is compiled you can use it as a standalone everywhere in your object folders

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Dec 2012 20:26
@TheComet and @Scorpyo thank you for helping me out with code.

@Brendy boy and @MrValentine thank you for your advice.

Login to post a reply

Server time is: 2026-07-08 05:58:36
Your offset time is: 2026-07-08 05:58:36