Blitz 3d

Take a look at this model:
http://www.blenderwars.com/models/Models/awing.zip

It’s pretty cool, huh?
I’m currently using the Blitz3D programming language, and before I say anything else, it’s the DEMO version, in case that makes any difference.

I can export the mesh from blender into .3ds format or .x format which are both compatible with blitz 3d, or use biturn to convert to .b3d format.
But I have a big problem - no matter what I seem to do, the textures don’t show up when i load it into blitz 3d OR when I view it in biturn.
I.e. all i get is a grey model, with no textures.

I use the loadmesh command, and i’ve put the textures in the same folder as the model file. Do I need to do anything special in blender in order to make this work? Does anyone have any suggestions why it’s not working.

I’m very confused.

I am still working on it
I tried it last night no luck yet. the textures aren’t exporting. did you look at the .x file? Fox:). I think I know what the problems are and it has to do with the Blender set up before you export and the file paths to the textures. I will try latter tonight and get back.
I would keep this in one thread from now on. the mods dont like all the double post.

I think whats happening is when you export the mesh all the separate parts ( that awing is made of allot of separate meshes) are getting combined into 1 mesh. I don’t know at what step in the conversion to a blitz file that this is happening. When that happens all the UV coordinates are lost, so are the textures cant be mapped correctly.
You can export each part of that awing separately and then put it back together in Blitz. Then Parent all the parts to one piece of the awing. Now that sounds like allot of work!! That model you are trying to use is not set up as a game model. I would use that awing as a reference and model your own. Use fewer parts and less texture maps.
I have been using the .x exporter from Blender RC2 and exporting 1 mesh at a time the textures are in the same folder as the .x files. I have made a real simple ship in Blender thats 2 meshes with 2 textures and did what I described above and it works good. One thing I found is the normals get reversed at export so flip the normals “in” before you export.
Try something simple first to try and find the snags in the conversion. How much Blender do you know? can you make your own model and uv map a texture on it? to run some tests. Let me know how it works. And ask any questions I know little about Blitz but I may be of help on the Blender end of things.

I just did some more test. It seems if you set the the Object center in Blender the same for each mesh, then as long as you export and import to the same 3d coordinates than each mesh will be aligned correctly. That can save allot of work in Blitz.

I just made a quick test with a cube which I uv-mapped with a simple texture (used only one texture; used Blender 242RC2). Then exported the file to .x. In the export script options I’v set the button: recalc normals. Then exported the mesh. I copied my texture into the same directory as the .x file and loaded the file in Blitz3d (using LoadMesh). Everything looks fine for me (I can see the textured cube in the 3D view). I use a full version of Blitz3D patched to version 1.96. What I found some time ago is that using multiple textures in Blender on a mesh (e. b. by assigning different textures to different faces using uv-mapping) gave problems when I tried to export these files and then import the file into Blitz3D. So I ended up writing a little converter that loads the .x file and converts it to a b3d file using all textures. It is based on the great b3dutils of Mark Sibly with some lines code around it. In case thats of interest for you, then please let me know, I’ll send you a PM with the code attached. One last remark: I assume that you have used uv-mapping for texturing your object. Anything else won’t work.

Some additional remarks and tests: 1) I checked the Awing-file and it looks that all textures were applied using the standard mapping methods rather than uv-mapping. I think you definitely need uv-mapped textures. 2) I can confirm shr1k’s findings about the .x exporter in Blender242RC. The .x exporter seems to handle multiple textures per object correctly (sorry, I have overseen this in shr1k’s last post). No need for a .x to .b3d converter then. 3) I agree with shr1k: this awing model is not set up as a game model. I recommend to follow shr1k’s proposal to build a simple model of the awing using much less polygons and parts and using the current model as a modelling reference. 4) My version of Blitz3D (full version 1.96) seems not to be able to load the awing file in .x format :frowning: So as you use a demo version of Blitz3D and obviousely can load the file the demo version seems to be OK. Now I have to find out my version of Blitz3D can’t load the model…

My knowledge of blender is quite limited - I have far more experience with blitz, but require some nice graphics to make anything of interest.

I’d prefer not to model something myself (i’m not very talented that way) so i’m leaning towards the idea of exporting each section of the A-wing individually and referring to the entire entity via a pivot.

So you’re saying if i just select one mesh, export it, place all the textures in the same file as the model, it should work correctly? Will I have to load each texture to each mesh or will it be automatic? If .x format doesn’t work with my version of blitz, will .3ds format work the same?

As said by shr1k you can align all centers before exporting each part of the mesh to save work afterwards. Then export each part separately. That will work.

However you need to uv-map the textures before exporting the different meshes. Otherwise you won’t see any texture at all (see also shr1k’s second post). This is what you have to do in Blender before exporting the separate meshes.

Assigning a texture without uv-mapping will result in a weird result if applied in Blitz (via using a brush, see image).

Attachments


That’s brilliant then!
This is the closest i’ve ever got to being able to do this.

So how do I set the centers to be the same?

To place all object centers to the same location in Blender
In object mode
First put the 3d cursor where you want the centers to be. you can do this with LMB or shift-s will pull up a snap menu its self explanatory.
f9 key will bring up the mesh editing tab
Select all meshes. the easy way is to select all by type. on the tool bar in the 3d window is the select menu. Select-select all by type-mesh.
In the mesh editing tab is a button Centre Curso this button will move the object centers to the cursor. The widget will appear at the object center when you select an object.
The A-wing already has all the centers at the same location;).
I am using the DEMO of Blitz also and the .x file type works fine for me.

Anyone know how to make an animated mesh for Blitz with Blender? Or if it can be done?
BTW this is a good Blitz tut if anyone is interested.
http://jnoodle.com/Blitz3D/index.html
Another question does anyone know of a forum with Blitz users that I can join having only the DEMO?

Gaming Universe Forums are quite good for demo version of Blitz3D.

Okay, next questions:
(oh and by the way, I really appreciate all your hard work - you’re the first people to give me any good answers on this, and I’ve been asking it on various forums for ages.)

I presume I can still use the packed textures to do the UV mapping? If so, how do I do this? I’ve never done any UV mapping before. Do I need any additional software?

@shr1k: you might want to give www.codersworkshop.com a try. It is the former blitzcoder.com site and seems to allow registration only via email and name (now buidlID necessary as is for blitzbasic.com).

You definitely can use keyframe animation generated in Blender in Blitz3D. Did that some time ago, works fine. Just export e. g. as .x mesh, animations should be exported as well. I haven’t checked bones yet;

@JamesRobinson59281: Blender has very good uv-mapping tools. No need to have another software :wink:

As uv-mapping is not always an easy task I strongly recommend to check the BlenderWiki (www.mediawiki.blender.org).

Lookout for articles like Unwrapping Suzanne or UV-Editor. These articles are a most valuable resource.

Depending on your uv-mesh it might be possible to reuse the textures that came along with the model. However I am not sure whether that will be possible for that particular mesh.

I still cant get an animated mesh into blitz3d I tried can you share some instructions. I am not sure if the export is not working or if I have the Blender animation set up wrong. I can load and animate other meshes in Blitz all .b3d examples. I cant find an .x to test and none of mine work. which .x exporter are you using? I would really like to find a way to get bone animation from Blender to a .b3d file,I don’t mind using another app to convert but I cant afford 3Dmax:rolleyes:. I am trying Milkshape now I just downloaded it.

Thanks for your feedback about the .x files - I wasn’t aware that the .x file exporter seems to have changed that much (for DirectX export before DirectX8).

The DirectX exporter I used for my tests was the export script in Blender 2.37a (actually it is some time ago when I used that export and assumed it to work in later versions of Blender as well), Apologies for having set you on the wrong path! :frowning:

The current .x file export in Blender 2.40 and in particular in 2.42 seems to support the x-file format of DirectX8 and higher. However Blitz3D is based on DirectX7 for which the x-file format spec. is different. So the animation won’t work right or not at all. I haven’t had the time to compare the two files in all details yet to get an idea about what is wrong.

BTW: the currenty x-file exporter seems to have a little bug as it creates additional vertices. When you export a simple cube (8 vertices) the x-file contains 24 verts. After reimporting that into Blender you can remove these verts by clicking remove doubles.

The bone export generated by the x-file exporter is not supported in Blitz3D (at least this is my finding so far; I did some tests recently and couldn’t get it to work).

There is a plugin for Milkshape available from Mark Sibly, the creator of Blitz3D. You can download it from the blitzbasic.com homepage. The link is: http://www.blitzbasic.com/sdkspecs/sdkspecs.php.

I had a quick look through the code and so far I can see this plugin exports the mesh, textures and animations into native b3d format! So using Milkshape might be a quite good try.

I hope that this can help a bit anyway and again sorry for pointing you in the wrong direction in my last post: I forgot that I used Blender 2.37a for my tests.