loading a mesh

Blitz3D Forums/Blitz3D Beginners Area/loading a mesh

Jack(Posted 2009) [#1]
I am OK with the blitz commands for loading meshes but I am trying
PNP TerrainCreator and when I export from that program I get 64 files for one mesh.

I suppose this is something I should have answer for but I don't.
What do I do to get this into Blitz?

PNP really seems to do a nice job of making a "mesh terrain" so any
help would really be appreciated.


John Blackledge(Posted 2009) [#2]
If you look on the website you see in 'Export Functionality':
Heightmap
Texturemap
object
Vegetation
Sound
Mesh
Scene

All you really need is a heightmap and a colourmap.
View your 64 files in Windows Explorer in Thumbnail View mode, and try to work out which are the height and colourmaps.


Jack(Posted 2009) [#3]
Thanks John but I sure do not understand what your saying.

In the PNP exporter under "mesh" there are five choices and "export to Blitz3d" is one and "X" is another. So I exported without texture to both
and got 64 b3d files so i tried X and got 64 X files. After I textured in PNP I exported and got 128 files.

I see how to export as a BMP I want a mesh file. Don't want to make a Blitz Terrain out of a height map.

Am I missing something?


Warner(Posted 2009) [#4]
Isn't there a .bb file or example somewhere? That might be helpful.
It sounds to me like the terrain is divided into small parts to optimise rendering. If you have 64 files, it is most likely a grid of 8x8 meshes.
This code might help to load the terrain. I guessed the terrain is alligned along xz-axis. Also, x and y might be reversed, since I did not know in what order the tiles are exported. I assumed the filenames go from "terrain0.x" to "terrain63.x".
In short: it might not work out of the box, but with a little tweaking, it might.



Jack(Posted 2009) [#5]
Thanks Warner.. Wlil give this a shot and I think that you are correct.

PNP generates your created terrain in sections according to a number you input.

So it was a default 64 which generated 64 files. Noticing this I set that figure 10 1024 and got only 1 file.

At that point I understood my problem but still did not have answer as to how to get it into blitz, I think you just supplied the answer.

Thanks again.


Jack(Posted 2009) [#6]
Well Warner there must be something I'm doing wrong since at the line
x# = (i mod 8) * meshwidth(mesh(i))
I get an "entity not defined" error which I have gotten when loading just
large file.

Of course i changed the file extension to ".b3d"


John Blackledge(Posted 2009) [#7]
"export to Blitz3d" is one"
"Don't want to make a Blitz Terrain out of a height map."

I suggest that's exactly what you should do - the simplest option, while you're getting used to how PNP wants to work.


Jack(Posted 2009) [#8]
John ....have you had experience with PNP.


Jack(Posted 2009) [#9]
John....I don't want a terrain or I would make one.


John Blackledge(Posted 2009) [#10]
Then what exactly are you trying to do?