Texture problem with AddMesh...

Blitz3D Forums/Blitz3D Programming/Texture problem with AddMesh...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi, I'm trying to weld a group of objects together. I'm using AddMesh and then trying to texture the new model. The texture appears the same as if I were using seperate models. Is there any way to weld more than 1 models vertices together with other models and be able to texture them as a single model?

This is what I've got so far,

Graphics3D 640,480,16,2
SetBuffer BackBuffer()

;-------;
; Setup ;
;-------;

Camera	= CreateCamera()
Light	= CreateLight()

MoveEntity Camera,0,0,-10
TurnEntity Light,45,45,0

AmbientLight 100,100,100

;---------;
; Texture ;
;---------;

Texture = CreateTexture (32,32)

Color 0,0,150
Rect 0,0,32,32,True
Color 0,0,250
Rect 0,0,32,32,False

CopyRect 0,0,32,32,0,0,FrontBuffer(),TextureBuffer(Texture)

RotateTexture Texture,45

;-------;
; Scene ;
;-------;

Scene = CreateMesh()

CubeA = CreateCube()
CubeB = CreateCube()
CubeC = CreateCube()
CubeD = CreateCube()
CubeE = CreateCube()

PositionMesh CubeA,0,2,0
PositionMesh CubeB,0,-2,0
PositionMesh CubeC,-2,0,0
PositionMesh CubeD,2,0,0
PositionMesh CubeE,0,0,0

AddMesh CubeA,Scene
AddMesh CubeB,Scene
AddMesh CubeC,Scene
AddMesh CubeD,Scene
AddMesh CubeE,Scene

FreeEntity CubeA
FreeEntity CubeB
FreeEntity CubeC
FreeEntity CubeD
FreeEntity CubeE

EntityTexture Scene,Texture

;------;
; Loop ;
;------;

While Not KeyDown (1)

If MouseDown (1) Then WireFrame True Else WireFrame False

TurnEntity Scene,0.1,0.2,0.3

UpdateWorld
RenderWorld
					
Flip
Wend
End