Uv mapping how it works in blitz3d?
Blitz3D Forums/Blitz3D Programming/Uv mapping how it works in blitz3d?
Do you know how it works?
I 'll try to explain my "experiment", i create a landscape with 3dsmax and textured it, i use some special material that will not exported in b3d files (like noise).. But if i'll create a texture map of the whole landscape and save it as image files (jpg or bmp i dunno) in what way can i load it from blitz3d?
I mean i already set uv cordinator in the mesh using 3dsmax what way can i set the texture to the mesh? Just loadtexture/entitytexture?
I haven't tried yet do you think there is a possibility to do it?
Aza
You should just be able to use Loadtexture, to load that texture in, then EntityTexture, as you say.
Perfect..
Thanks
Aza
If your 3dsmax model has multiple materials, you 'll prefer use Brushtexture on the surfaces rather than EntityTexture
+> use a function like this
function Materialtexture(IdSurface,Texture,Frame%=0,Layer%=0)
s=getsurface(Model,Id)
b=gettexturebrush(s)
BrushTexture(b,Tex,Frame,Layer)
paintsurface(s,b)
freebrush b
end function
And take care with the material ids, there are not always the sames as in 3dsmax.
Thanks but..
Can you explain me why i took a texture of a surface to a brush with "b=gettexturebrush(s)" if i set a texture to it later with "BrushTexture(b,Tex,Frame,Layer)", i mean i don't understan why i need to receive the texture in the brush if later i overwrite it with another tex.
My second problem is i use some special material in 3dsmax and it will NOT exported in b3d format (because its on directx9), i want create a texture in 3dsmax and aplly the texture to the mesh in b3d (in this way i don't have to export the material but just apply an already exported image).
Do you think it will working?
This afternoon i'll try it.
Aza
in the function, it's missing :
if b<>0
You'll have to use it to check if the brush already exists.
When you load a mesh/AnimMesh, there are internal brushes, and the surface may contain a brush, that has no texture.
You'd better use this brush rather than create a new one => when you apply "EntityTexture", it performs a brush to all the surfaces of the mesh.
You sometimes do not need that. => Sometimes you have a mesh containing multiple ssurface, and each have its special texture. In this case, you have to use different brushes .
Now this make sense, thanks for the advice i'll try this afternoon and the day after tomorrow i'll post my result..
Thanks
Aza