Save Mesh

Blitz3D Forums/Blitz3D Programming/Save Mesh

Paul "Taiphoz"(Posted 2004) [#1]
Hay all. I'm Working on a project at the minute.

What Im doing is loading in 2 mesh's Im then adding them together with AddMesh.

And im then useing part of a save to b3d function that I found in the archives.

The toruble is that the save function does not save out the texture information. So my wee object's all white..

Anyone able to help me with this ?


ckob(Posted 2004) [#2]
you have to save out the mapping I once asked this too and was told that you have to save the mapping coordinates how you do it is totally up to you..hope this helps :)


jfk EO-11110(Posted 2004) [#3]
Hi Yavin. I posted the SaveB3D Example from the Code Archives. It worked well with several test meshes. It should at least print some warnings to the screen, when textures are not defined or texture-files are not found.

Did you try to display the result of AddMesh onscreen? Did this look right? Or was it white as well?

Please note: the Example SaveB3D expects everything to be in the same folder: .bb program, mesh file and textures.

One important trick to make AddMesh work as desired is you should not use "Entity-Commands" before you add them together. Instead use "Mesh-Commands". Examples given:

Use PaintMesh instead of EntityTexture
LoadBrush instead of LoadTexture
PositionMesh instead of PositionEntity
...

Then also make sure the handle you are trying to save is a mesh, and not some kind of parent pivot or something.


Paul "Taiphoz"(Posted 2004) [#4]
Hay jfk any chance of a link to them ? I think I might have some one else example.

As this writeb3d does not have a return value set for it.

Ill explain a bit more about what im doing.

I have a tree trunk. and a leaf mesh.

Both are textured.

I tereate through the trunk looking for bits named "node1" when I find one I addmesh a leaf mesh to it at the right position.

The end result is a Nice looking tree. but when I use the functions I have at the moment, when I export it I just have a white mesh.

/me is off to hunt down jfk's example