3D load model question

Previous topic - Next topic

shawnus

Hi all- this code:

FUNCTION lMdls:
   lTxts()
   heart% = EntityLoadMesh("heart.ddd")
   EntitySetName(heart%,"Heart")
   skeleton% = EntityLoadMesh("skeleton.ddd")
   EntitySetName(skeleton%,"Skeleton")
   torso% = EntityLoadMesh("torso.ddd")
   EntitySetName(torso%,"Torso")
   cHead% = EntityLoadMesh("head.ddd")
   EntitySetName(cHead%,"Head")
   cArm% = EntityLoadMesh("arm.ddd")
   EntitySetName(cArm%,"Arm")
   cSpin% = EntityLoadMesh("spin.ddd")
   EntitySetName(cSpin%,"Spindle")
   cBody% = EntityLoadMesh("body.ddd")
   EntitySetName(cBody%,"Body")
   cTable% = EntityLoadMesh("table.ddd")
   EntitySetName(cTable%,"Table")

   EntityMove(skeleton%,0,-20,55)
   EntityMove(torso%,5,-35,25)
   EntityMove(cHead%,0,66,0)
   EntityMove(cBody%,98,-68,0)

//   EntitySetAlpha(heart%,0.5)
   EntitySetAlpha(skeleton%,0.9)
//   EntitySetAlpha(torso%,0.5)
//   EntitySetAlpha(cHead%,0.5)
//   EntityEnable(cHead%,FALSE)
   EntityApplyTexture(heart%,heartTex%,-1)
   EntityApplyTexture(skeleton%,skeletonTex%,-1)
   EntityApplyTexture(torso%,torsoTex%,-1)
ENDFUNCTION

Loads some .ddd models, names & textures some of them, etc. Works fine. However when I change the code so that the 'heart%' has been assigned to a new .ddd model (ladmsh.ddd) i.e:


FUNCTION lMdls:
   lTxts()
   heart% = EntityLoadMesh("ladmsh.ddd")
   EntitySetName(heart%,"Heart")
   skeleton% = EntityLoadMesh("skeleton.ddd")
   EntitySetName(skeleton%,"Skeleton")


The 'ladmsh.ddd' model does not appear and is replaced by the 'skeleton.ddd' model, positioned where the heart used to be. Oddly enough when I change the code again to load a non-existent model ('ladmshhhhh.ddd'):

FUNCTION lMdls:
   lTxts()
   heart% = EntityLoadMesh("ladmshhhhh.ddd")
   EntitySetName(heart%,"Heart")
   skeleton% = EntityLoadMesh("skeleton.ddd")
   EntitySetName(skeleton%,"Skeleton")

The same thing happens, but there is no error message (which I would expect if I tried to call up an incorrectly named mesh).
Any advice appreciated!

Cliff3D

GLBasic tends not to issue errors on being given incorrect filenames for things (sprites/images for example and, based on your code, 3D meshes) instead using the command to "clear" a variable of that type. It looks to me like your ladmsh.ddd might be corrupt?

shawnus

No actually I am corrupt by omitting to put the model into the app media folder.  Sorry!! This is why I will never be a developer.
Thanks for the reply Cliff3D, Cheers, Shawnus