Textures on Model - Need Direction

Blitz3D Forums/Blitz3D Beginners Area/Textures on Model - Need Direction

Imperium(Posted 2012) [#1]
Okay so I got my model all ready for use with Blitz3d. But I can’t seem to wrap my head around how to apply the texture to the model inside Blitz3d.

Here is the process I followed:
1. Created model in Maya.
2. Added the UVmap.
3. Exported UVmap as targa and png.
4. Exported model as Obj. and into 3dsmax.
5. Exported from Max into .3DS format preserving max coordinates.
6. Painted metal texture onto Targa.

So what should I do next? According to my research the .X format preserves the uv and the texture data inside. I have a dated .X exporter for Maya 4.5 that works with the latest Maya (to my surprise!) , should I ditch using 3ds in favor of .X? What about the B3d format? The Blitz3d book states that .B3d offers the most set of features.


For a little over 3 days I have messed with the Xfighter demo, my game concept I am working on is heavily based on an old Domark game called Absolute Zero and a game titled Battlezone 2 Combat Commander. The pictures below are not representative of the final product. Everything is work in progress.




Absolute Zero:
http://www.youtube.com/watch?v=48rV34IpE10
3d Gameplay way before 3d cards. The detailed mission briefings and graphics of this game blew my mind as a kid.

Battlezone 2:
http://www.mobygames.com/game/windows/battlezone-ii-combat-commander
Unique FPS/RTS hybrid. Very fun game if you're willing to learn it.

Last edited 2012


Yasha(Posted 2012) [#2]
The .b3d format is the best format if you can export to it. The other formats have no advantages except the easier pipeline, and should be avoided if possible.

Your problem is in two parts:

3. Exported UVmap as targa and png.

6. Painted metal texture onto Targa.


This doesn't do anything. A UV map is an inherent property of the model; it can't be exported by itself (at least, not in any way useful to Blitz3D). Ditch step 3, because it does nothing - unless you're using the UV wireframe as an art guideline, anyway.

The best way to apply a texture is to apply it in the 3D editor. This means not having to do anything in Blitz3D because the texture will be loaded when you use LoadAnimMesh (might not work with LoadMesh, can't remember... either way, if in doubt, LoadAnimMesh is generally better). And of course anything that shortens your code is a good thing!

Otherwise... export the texture to .png, load it with LoadTexture, apply it with EntityTexture. All done. (If you have tried this - it sounds like you haven't - please do say, sometimes there are slightly more complicated problems with imported models.)


Imperium(Posted 2012) [#3]
I'm very new to Blitz3d but somehow that doesn't sound right or I'm simply not following what you mean? The UVmap is what the texture will wrap around on the model. You are correct that the UVmap is part of the model but the texture is always loaded from an external source. This does not appear to be the case with the .X or was it the .3ds format? I cannot find the post I read that discussed this very issue.

After looking over the unmodified code in the Xfighter demo I cannot find anywhere where the biplane.bmp texture is referenced? The biplane model is in the X. format.

Last edited 2012


Matty(Posted 2012) [#4]
Create your model in your modelling app.

Apply the texture in your modelling app (any of BMP,JPG,TGA,PNG,DDS formats). Make sure the uv coordinates are set correctly...this differs from modeling app to modeling app.

Export in format of choice.

Load model with loadmesh or loadanimmesh ..

Textures will load as well...no need to use entitytexture command...

Things to be aware of -

.x format that blitz uses only has a single uv coordinate set...so no lightmapping with .x format (use b3d format for this).

.3ds format likes texture filenames to be of length 8.3 (filename format) otherwise they won't load..don't use 3ds it's a worthless old format anyway.

.b3d format is the best format to use because it supports lots of features...but if you just want to see your mesh textured then any of these will do.

(oh and .md2 format - useful for animations if you want lots of animated low res meshes...faster than bone animations with b3d).

texture filename should be in the same path as the model (not strictly necessary but keeps things easier to manage) - and make sure in your modeling app it does likewise.


Imperium(Posted 2012) [#5]
Thanks for the help everyone! I will make another attempt at it tomorrow and post the results. Right now I'm playing with a 3d program called Wings 3d. Seems easy to use if only I could figure out the UV mapping for it.

Does any practical/easy solution exist for Maya or Max in regards to the .B3d format?

http://www.onigirl.com/pipeline/
The link above seems like a great solution but where the heck do you actually download the B3d Exporter?

Last edited 2012


K(Posted 2012) [#6]
1) Meshes are composed of Surfaces,
2) Those are made of Triangles,
3) Each Triangle has three Vertices

Every Vertice has a number of properties, X,Y,Z,NX,NY,NZ... Positions and orientations(for lighting), and also, pertinently: U,V,W
Ignore W, it was never implemented. But UV maps to SPECIFIC PIXELS on the image. So, as Yasha said,
step 3, because it does nothing - unless you're using the UV wireframe as an art guideline, anyway.


Yes, you could export that and draw a texture on it, load that and apply it in blitz as if texturing any other mesh. But the better solution, as suggested, is to draw your texture, then apply it in the modeller itself.
3ds,X,and B3d all remember what textures were applied to them, so long as the images are placed in the same directory as the mesh file.
If you do this, all you must do is LoadMesh()/LoadAnimMesh().

Last edited 2012


Imperium(Posted 2012) [#7]
Thanks for the help Yasha, Matty, and K!

Having no issues now. Once I finish revamping the model and give it some proper textures I'll post a new screen. You guys rock!

Last edited 2012