Mesh+Texture

Blitz3D Forums/Blitz3D Beginners Area/Mesh+Texture

Why does it not work, please?
I tried with a brush but it gave me a blured uni texture too when i apply it to a mesh, why, please?

I'm confused on what you need help on.

Scale down your texture using scale texture. And try to be more specific or post some code, please. You do not need a brush to texture a mesh.

Make sure the mesh has UV coords defined to accept a texture.

mesh=CreateMesh()
	For x=0 To nSurfX
	For z=0 To nSurfZ
		surf(x,y)=CreateSurface(mesh)
		For x2=0 To nTile
		For z2=0 To nTile
			vert(x,y,x2,z2)=AddVertex(surf(x,y),(x*nTile*wTile)+(x2*wTile)-(nSurfX*nTile*wTile)/2,0,(z*nTile*wTile)+(z2*wTile)-(nSurfZ*nTile*wTile)/2)
			;c=CreateCube()
			;PositionEntity c,(x*nTile*wTile)+(x2*wTile)-(nSurfX*nTile*wTile)/2,0,(z*nTile*wTile)+(z2*wTile)-(nSurfZ*nTile*wTile)/2
		Next
		Next
		
		For x2=0 To nTile-1 
		For z2=0 To nTile-1 
			v00=vert(x,y,x2,z2)
			v01=vert(x,y,x2,z2+1)
			v11=vert(x,y,x2+1,z2+1)
			v10=vert(x,y,x2+1,z2)
			;DebugLog v00+"."+v01+"-"+v11
			
			t1=AddTriangle(surf(x,y),v00,v01,v10)
			t2=AddTriangle(surf(x,y),v01,v11,v10)
			;DebugLog t1+"."+t2
		Next
		Next
		
	
	Next
	Next
	UpdateNormals mesh
tex=CreateTexture(256,256)
	SetBuffer TextureBuffer(tex)
	For i=1 To 256
	For x=0 To 256
	Color Rand(255),Rand(255),Rand(255)
	Plot x,i
	Next
	Next
	Color 0,0,0
	Rect 0,0,256,25
	SetBuffer BackBuffer()


c=CreateCube()
EntityTexture c,tex
EntityTexture mesh,tex


anyone, please?

What DJWoodgate said, you didn't define the UV coordinates. Have a look at the VertexTexCoords() command.

You can add the UV-coords at the addvertex command if you want also :o)

Thanks a lot....