Several Textures on 1 Mesh (restart)

Blitz3D Forums/Blitz3D Beginners Area/Several Textures on 1 Mesh (restart)

AJirenius(Posted 2006) [#1]
Ok, I will try to be as clear as I can be:

This is what I actually want to do.
I have modelled a big arena of estimated 3000 polygons in 3dsMAX. This arena is textured with several textures on different faces (that means that I use several texturemaps on the arena but dont blend several textures on one face. Now even if I have applied several textures on the arena in 3dsMAX its still ONE mesh. I've used so called Material ID's to achieve this.

Now, when I export the mesh into *.3ds format the data about where the different textures will be placed ARE stored with it (as I can open the mesh in different engines and it applies all the textures correctly on this one mesh). When I load the mesh in Blitz3D and remember to place all the textures used in the same folder Blitz3D actually does the same: finds all textures and place them on this single mesh correctly.
So my problem at the moment is solved.

The question is, what if I want to put a texture only on certain specific faces on one mesh in Blitz3D. Use brushes and surfaces you say? But how do I select the specific faces to be included in the surface? What if the mesh is very detailed (as my arena)?


Yeshu777(Posted 2006) [#2]
Each surface will have an index.

surf = GetSurface(mesh, surface_index)
PaintSurface(brush, surf)

surface_index is the specific face you wish to texture, which is always a little trial and error for me as I don't create the models.


AJirenius(Posted 2006) [#3]
???

So you mean that if I eg. modelling a soldier (about 2000 polys) and then want to apply a reflect map just on the armour and some details on on crown his wearing I have to go "trial and error" around 2000 faces????

... there is no other solution is it?


jfk EO-11110(Posted 2006) [#4]
you really should save the armour as a seperate surface. In 3ds max you simple have to seperate the tris from the main mesh to achieve this. Working with Matrial ID's may work too since a seperate Surface will be created in Blitz automaticly for every brush.

The index of the surfaces will not be the same every time, so you cannot rely on the index! Instead use a method that is used in the SaveB3D example (archives) to track down the filenames of the used textures to identify surfaces. If loaded using LoadAnimMesh you may also use FindChild to identify certain scene child objects, tho not sure if this works with Material IDs too.


b32(Posted 2006) [#5]
If
1) you applied 2 textures on one mesh, and
2) the original texture files are not changed (merged) by the exporter, and
3) in Blitz3D the right texture is at the right triangles
You could replace the texture. In its most ugly form, it would be: overwriting one of the texture files with another and reloading the mesh.
However, the object should have 2 surfaces, one for each texture. Because that is not the case, it could be that the exporter has merged the textures. In that case you will have to paint the triangles yourself.
Is the armour a submesh ? Then you could export it as a separate object. Or maybe use LoadAnimMesh instead of LoadMesh, because it keeps the original mesh hierarchy.
If not, you could paint the armour red with a red matte. Your program should then recognize all the red triangles, and repaint them with the armour texture.


Yeshu777(Posted 2006) [#6]
Don't confuse the number of polys and surfaces.

A surface is defined by the texture applied to an area of polys in the model.

Eg. I'm been using a model of an apple, I have 3 surfaces the skim, leaves and stalk. Each area has a unique texture and Blitz3d see's this as a surface.

Using the brush commands works well for me.