animation and texture

Blitz3D Forums/Blitz3D Programming/animation and texture

yoshark(Posted 2013) [#1]
I recently have been dealing with animated objects and using directx (.x) files while coding. I've encountered trouble with loading a texture to be used for the .x file. It seems I can't use the "loadtexture" command. Any help?

heres the code for my .x file
upmesh=LoadMesh("leftshark.x"):HideEntity upmesh
md=LoadMesh("shark.x"):HideEntity md
dnmesh=LoadMesh("rightshark.x"):HideEntity dnmesh
final=LoadMesh("shark.x")
ScaleMesh upmesh,1.5,1.5,1.5
ScaleMesh md,1.5,1.5,1.5
ScaleMesh dnmesh,1.5,1.5,1.5
RotateEntity final,0,180,0



Guy Fawkes(Posted 2013) [#2]
Make sure the texture is in the same folder as the model.


RemiD(Posted 2013) [#3]
Some things to note :
If you use LoadMesh(), this will load a non rigged (without joints), non skinned (without influences of some joints over some vertices), non animated (without animation sequences) mesh

If you use LoadAnimMesh(), this will load a rigged (with joints), skinned (with influences of some joints over some vertices), animated (with animation sequences) mesh

Concerning the texture, you have 3 ways to texture a mesh
1->Apply the texture to a surface of a mesh in an external editor and only load the mesh in Blitz3d, the texture will be applied to the mesh automatically (it must be in the same path that it was defined before)

2->Load the mesh in Blitz3d, apply a texture to the whole mesh (all surfaces) by using
EntityTexture(Mesh,Texture)

3->Load the mesh in Blitz3d, retrieve the id/handle of each surface, apply a texture to each surface by using
Surface = GetSurface(Mesh,SurfaceId)
Brush = CreateBrush()
BrushTexture(Brush,Texture)
PaintSurface(Surface,Brush)
FreeBrush(Brush)

Hope this helps


yoshark(Posted 2013) [#4]
thank you for the new useful information!