;chassis coding taken from caravan.b3d byAdam Priseman
;Wheel texture from Alan Wheeler aka guillyman, Thanks!



;Mablethorpe Caravan;
;front
CreateMeshBuilder,
AddVertex,-2,0,0,
AddVertex,-2,2.5,0,
AddVertex,2,2.5,0,
AddVertex,2,0,0,
AddFace,0,1,2,3,
GenerateNormals,

LoadTexture,CFront.bmp,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,

;Side
CreateMeshBuilder,
AddVertex,2,0,10,
AddVertex,2,2.5,10,
AddVertex,2,2.5,0,
AddVertex,2,0,0,
AddFace,3,2,1,0,
GenerateNormals,

LoadTexture,CSide1.bmp,
SetTextureCoordinates,0,1,1,
SetTextureCoordinates,1,1,0,
SetTextureCoordinates,2,0,0,
SetTextureCoordinates,3,0,1,

;back
CreateMeshBuilder,
AddVertex,-2,0,10,
AddVertex,-2,2.5,10,
AddVertex,2,2.5,10,
AddVertex,2,0,10,
AddFace,3,2,1,0,
GenerateNormals,

LoadTexture,CFront.bmp,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,

;Side
CreateMeshBuilder,
AddVertex,-2,0,10,
AddVertex,-2,2.5,10,
AddVertex,-2,2.5,0,
AddVertex,-2,0,0,
AddFace,0,1,2,3,
GenerateNormals,

LoadTexture,CSide1.bmp,
SetTextureCoordinates,0,1,1,
SetTextureCoordinates,1,1,0,
SetTextureCoordinates,2,0,0,
SetTextureCoordinates,3,0,1,

;roof
CreateMeshBuilder,
AddVertex,-2,2.5,0,
AddVertex,2,2.5,0,
AddVertex,2,2.5,10,
AddVertex,-2,2.5,10,
AddFace,3,2,1,0,
GenerateNormals,

LoadTexture,CRoof.bmp,
SetTextureCoordinates,3,0,1,
SetTextureCoordinates,0,0,0,
SetTextureCoordinates,1,1,0,
SetTextureCoordinates,2,1,1,

;chassis

Createmeshbuilder
addvertex, 1.3,-0.75,0.5
addvertex, 1.3,-0.75,10
addvertex, 1.3,0,10
addvertex, 1.3,0,0.5
addface2, 0,1,2,3
GenerateNormals,

LoadTexture, underframe1.bmp
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1
Transparent, 0,0,255

Createmeshbuilder
addvertex, 1.25,-0.75,0.5
addvertex, 1.25,-0.75,10
addvertex, 1.25,0,10
addvertex, 1.25,0,0.5
addface2, 0,1,2,3
GenerateNormals,
LoadTexture, underframe1.bmp
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1
Transparent, 0,0,255


Createmeshbuilder
addvertex, -1.3,-0.75,0.5
addvertex, -1.3,-0.75,10
addvertex, -1.3,0,10
addvertex, -1.3,0,0.5
addface2, 0,1,2,3
GenerateNormals,
LoadTexture, underframe1.bmp
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates ,1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1
Transparent, 0,0,255

Createmeshbuilder
addvertex, -1.25,-0.75,0.5
addvertex, -1.25,-0.75,10
addvertex, -1.25,0,10
addvertex, -1.25,0,0.5
addface2, 0,1,2,3
GenerateNormals,
LoadTexture, underframe1.bmp
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1
Transparent, 0,0,255






Createmeshbuilder
cylinder, 10,0.05,0.05,2.5
translate, -0.5,0,5.28
Rotate, 0,0,90,90
color, 50,50,50
