multitexture

Blitz3D Forums/Blitz3D Programming/multitexture

Bnesiba(Posted 2006) [#1]
if i have a mesh, that has multiple surfaces, how do i texture them with blitz?

i know that multitextured meshes have a surface for each texture, but if i use entitytexture on a surface, it has a "entity does not exist" error. is there any other ways to do this?


Bobysait(Posted 2006) [#2]
maybe you refered a bad filename for the LoadMesh.

However, you're wrong.
=> Multitexture just texture a mesh with different Layer. It does not add surface to the mesh.

to multitex , you need to use

EntityTexture Mesh,Texture1,0,0
EntityTexture Mesh,Texture2,0,1 <= the last setting is the layer order of the texture !

if you want only texture surface with different texture, you will need to specify the BRUSH .
Let have a seen to the doc at those commands.


Bnesiba(Posted 2006) [#3]
i know the loadmesh() worked since i can see the mesh on the screen (i'm writing a 3d program). but what i'm trying to do is be able to choose certain faces, and assign only those faces a texture. the only way i can think of doing think is surfaces.

i dont understand what you are telling me to do with entitytexture, but i dont see how that would be able to only texture a few faces, and not the rest.


jfk EO-11110(Posted 2006) [#4]
There's a command PaintSurface. You may LoadBrush the texture, then apply it to individual surfaces using PaintSurface. But there's a problem with the order of surfaces when loaded using LoadMEsh - they may not be the same every time, so you should not try to access surfaces by index, when loaded with LoadMesh. When they are already textured, then you may track down the filepaths of the textures, as seen in the SaveB3D example in the code archives to identify certain surfaces.

An easier solution is to load the mesh with LoadAnimMesh, this will make a child for every surface / object in the scene. The children can be identified using FindChild or EntityName etc.


Bobysait(Posted 2006) [#5]
what i said was to answer :

i know that multitextured meshes have a surface for each texture


And sorry but that is totally wrong.

And If you want to texture tris with different textures, it 's not what we call "Multitexturing" .
=> here you need to have one surface for each material you want to use.
add a brush to the surface, and use PaintSurface to apply the brush to the surface. (like said jfk )

But something strange in what jfk says :

An easier solution is to load the mesh with LoadAnimMesh, this will make a child for every surface / object in the scene


In any way, i have never seen we can get surface using FindChild ...
you're maybe right, but when I export a b3d Scene, and i load it, every surfaces of the scenes are contained in each mesh i have exported. using for the Meshes, but i have to use GetSurface ( Child , Index of the surface ) to get the surface.

Maybe i misunderstood ... Let me know .