Syntax

Result = dbLoadObject(Filename.s, ObjectID [, TextureMode [, TextureReduce]])

Description

If #PB_Any is used as the ObjectID parameter, the new ID will be returned as 'Result'. Otherwise the value of 'Result' is the same value passed as the ObjectID parameter.

This command loads a model into the specified 3D object number. You must specify a model in the X, 3DS, MDL, MD2 or MD3 format. Once you have loaded the 3D object file successfully, you can use the specified 3D object number to position, rotate, scale, animate and manipulate your 3D object. The object number should be specified using an integer value. The optional TextureMode parameter controls how the data loaded from the model is handled, and which behaviour is required. An additional Reduce Texture mode also controls a run-time scale down of the loaded texture plate. Be aware that when you load an object that has associated textures, you are handing over texture management to the engine which will attempt to save texture memory by re-using textures previously loaded from the same filename. To take over texture management, use dbLoadImage and dbTextureObject commands.

'TextureMode' can be one of the following values:

#GDK_Basic3D_Legacy             : DarkBasic Classic legacy behavior
#GDK_Basic3D_DBPro              : DarkBasic Professional default behavior
#GDK_Basic3D_KeepDiffuseState   : Preserve the diffuse state
#GDK_Basic3D_KeepTextureState   : Preserve the texture state
#GDK_Basic3D_BlendDiffuseTexture: Merge the diffuse and texture states at stage 0
#GDK_Basic3D_NoModifyState      : Do not modify texture states


'TextureReduce' can be one of the following values:

0: No reduction
n: Divide by n

See Also

dbAppendObject, dbInstanceObject, dbCloneObject, dbDeleteObject, dbDeleteObjects, dbObjectExist, dbSaveObject, dbSetGlobalObjectCreation