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.

Newcomers AppGameKit Corner / What constitutes a separate child object when using LoadObjectWithChildren

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 12th Dec 2017 04:36 Edited at: 12th Dec 2017 05:26
Ok starting with the question:
How does AppGameKit know when one child mesh ends and the next one begins when you use LoadObjectWithChildren to load a level?

I made a level in maya. It's a large mesh that acts as a terrain with a bunch of buildings, objects, foliage and trees scattered around it. Everything is textured, every object has it's own texture. NOW the issue is that if I export everything as one combined mesh then that means I'd have to also make a One texture file containing all the textures - Terrain ,Buildings, Foliage, Trees, etc. So the whole thing would get pretty damn big if I hope to keep any sort of discernible detail. BUT if I do that all the objects remain where they are precisely where I placed them in the model.

On the other hand I could export each object separately, which means I can have a separate texture file loaded for each one, BUT i"ll have to create a sort of level editor to position all objects, save and load system for that too (Which will happen, just not now).

The LoadObjectWithChildren is technically perfect, it loads objects as separate children and each child mesh can have a separate texture assigned to it. The issue is. How does AppGameKit know which meshes belong to which child? Can you group meshes or combine them? Combining kinda puts a big old nail on any further edits you wanna make to that object unless you do some duplication and saving shenanigans. If I have 3 things in my scene, One is the terrain (as one mesh) as well as an object #1 (made out of a cube, cone and a cylinder) and object #2 (made out of a sphere, a cone and a rectangle). Mind you none of these elements are combined so at any time I can grab the cylinder from Object #1 and move it next to the sphere of Objects #2 How would AppGameKit know what belongs to what child? Object grouping, Material Naming? Is there a way to predict or predetermine which mesh / object child is going to be which child id
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Dec 2017 13:04 Edited at: 12th Dec 2017 13:17
Help Manual --> Home --> Commands --> 3D -->

GetObjectNumChildren( objID )

GetObjectNumMeshes( objID )

GetObjectMeshName( objID, meshIndex )

SetObjectMeshImage( objID, meshIndex, imageID, textureStage )


Quote: "
GetObjectNumChildren
Description

Gets the number of child objects that were loaded as a result of loading this object. For example a bone animated character object may have a gun model attached to the bone representing its hand, this gun model would be loaded as a separate object and given its own ID, which you can manipulate separately from the main object. You can even detach the gun from the hand with FixObjectToBone(ID,0) to make it a normal object that will not move when the character moves. It will however always remain in this list of children, for reference, and will get deleted if DeleteObjectWithChildren is called on the character object. For those of you that are familiar with DarkBasic, objects that contained limbs in DarkBasic would be loaded as child objects in AGK. However there is no hierarchy in the child objects, they would not have children of their own. Instead a bone structure is created in the root object that represents the limb hierarchy, and the child objects are attached to the appropriate bones.
"

Looks like it is all bone based.

I'm guessing those separate meshes would be assigned to separate bones that are limbs.

Not my area of expertise (no area is ), so maybe the experts will join in the thread soon.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 12th Dec 2017 13:36
I think assimp will keep all meshes with the same texture in a group.
So if you want to add materials like I did in the lighting demo for the ShaderPack then you can seperate them via meshes/textures.
Maybe you can predict the meshes with the texture order inside the object file
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 12th Dec 2017 17:33
Ah, I see so the child system is mainly for rigged objects. Looks like I gotta make a level editor anyways.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net

Login to post a reply

Server time is: 2024-04-20 14:01:22
Your offset time is: 2024-04-20 14:01:22