LoadMesh and AddMesh problem?

BlitzMax Forums/MiniB3D Module/LoadMesh and AddMesh problem?

ima747(Posted 2009) [#1]
I used createcylinder to make some tubes and combined them into 1 mesh with AddMesh no problems. I'm trying to load a mesh for the junctions between the tubes with LoadMesh (tried LoadAnimMesh too just incase) and it loads and displays fine but add mesh doesn't seem to do anything with it. I can scale the mesh, move it etc, all with the mesh commands, just not add it to another mesh.

Known bug? Am I forgetting a step?


simonh(Posted 2009) [#2]
You might be adding the meshes in the wrong order, i.e. mesh1.AddMesh(mesh2) rather than mesh2.AddMesh(mesh1)

Whether the mesh has been loaded or created shouldn't make a difference.


ima747(Posted 2009) [#3]
Double checked, adding in the same order I am adding the tubes that work.

AddMesh(Tube, GameMesh) ' works

AddMesh(Junction, GameMesh) ' doesn't work


ima747(Posted 2009) [#4]
So it's not addmesh that doesn't work, it' something possibly stranger.

the add mesh works, however if I apply a texture to the loaded mesh data it seems to vanish. If I load the obejct I can see it. if I texture it it goes away, that includes with wireframe enabled. I can load and add the mesh and see it, but if I texture the mesh I'm adding everything to then those loaded segments vanish but the rest gets textured and works. again, those segments are gone in wireframe mode too.


simonh(Posted 2009) [#5]
Don't suppose you could knock up a quick sample that reproduces the problem could you?


ima747(Posted 2009) [#6]
I'll see what I can knock together. I assume it's just my model however. I'm going to poke around at my .b3d exporter and see if I can get it working by playing with some settings. when I invariably fail there I'll put up a sample :0)


ima747(Posted 2009) [#7]
imaProblem.zip

little demo stripped out of my app

W and S toggle wireframe and solid mode

T and C toggle the texture

A and D turn the camera


with the texture dissabled you can see the junctions, with it enabled they seem to vanish in both solid and wireframe.


Tue(Posted 2009) [#8]
Looks like it could be something with the texture coords of your junction model. Have you tested the junction model with a solid texture, so that you know it's right? And what 3D modeller have you used for the junction?


ima747(Posted 2009) [#9]
That's the trick. I forgot to map coords on the model entirely. I usually texture models in blender before I export them and somehow assumed it would have coords even though I never set them. Thanks Tue! problem solved.

I'm still a little confused about why it vanished in wireframe since I would think wireframe doesn't have anything to do with textures but apparently another bad assumption.

[solution] check your model, does it have coords?[/solution]