;SNCF wagon citerne
;Object and textures
;

;Sol

CreateMeshBuilder,
AddVertex, 1.4, 1.25, 6.20,
AddVertex,-1.4, 1.25, 6.20,
AddVertex,-1.4, 1.25,-6.20,
AddVertex, 1.4, 1.25,-6.20,
AddFace2,3,2,1,0,

LoadTexture,floor.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,

;Coté gauche

CreateMeshBuilder,
AddVertex,-0.95, 0.00, 6.21,
AddVertex,-0.95, 1.25, 6.21,
AddVertex,-0.95, 1.25,-6.21,
AddVertex,-0.95, 0.00,-6.21,
AddFace2,0,1,2,3,
GenerateNormals,

LoadTexture,chassis.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,
SetDecalTransparentColor,192,192,192,

CreateMeshBuilder,
AddVertex,-0.60, 0.00, 6.21,
AddVertex,-0.60, 1.18, 6.21,
AddVertex,-0.60, 1.18,-6.21,
AddVertex,-0.60, 0.00,-6.21,
AddFace2,0,1,2,3,

LoadTexture,chassis_2.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,
SetDecalTransparentColor,0,0,255,

CreateMeshBuilder,
AddVertex,-1.4, 0.00, 6.20,
AddVertex,-1.4, 1.25, 6.20,
AddVertex,-1.4, 1.25,-6.20,
AddVertex,-1.4, 0.00,-6.20,
AddFace2,0,1,2,3,

LoadTexture,side_front1.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,
SetDecalTransparentColor,192,192,192,


;Coté droit

CreateMeshBuilder,
AddVertex,0.95, 0.00,-6.21,
AddVertex,0.95, 1.25,-6.21,
AddVertex,0.95, 1.25, 6.21,
AddVertex,0.95, 0.00, 6.21,
AddFace2,3,2,1,0,

LoadTexture,chassis.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,
SetDecalTransparentColor,192,192,192,

CreateMeshBuilder,
AddVertex,0.60, 0.00,-6.21,
AddVertex,0.60, 1.18,-6.21,
AddVertex,0.60, 1.18, 6.21,
AddVertex,0.60, 0.00, 6.21,
AddFace2,3,2,1,0,

LoadTexture,chassis_2.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,
SetDecalTransparentColor,0,0,255,

CreateMeshBuilder,
AddVertex,1.4, 0.00,-6.20,
AddVertex,1.4, 1.25,-6.20,
AddVertex,1.4, 1.25, 6.20,
AddVertex,1.4, 0.00, 6.20,
AddFace2,0,1,2,3,

LoadTexture,side_front1.png,
SetTextureCoordinates,0,0,1,
SetTextureCoordinates,1,0,0,
SetTextureCoordinates,2,1,0,
SetTextureCoordinates,3,1,1,
SetDecalTransparentColor,192,192,192,

;Citerne

CreateMeshBuilder,
Cylinder, 20, 1.3, 1.3, 11
Rotate, 0, 1, 0,-90
Rotate, 1, 0, 0, 90
Translate, 0, 2.60, 0

Loadtexture, side_tank-2.png
Settexturecoordinates, 0, 0, 0
Settexturecoordinates, 1, 0, 1
Settexturecoordinates, 2, 0.05, 0
Settexturecoordinates, 3, 0.05, 1
Settexturecoordinates, 4, 0.10, 0
Settexturecoordinates, 5, 0.10, 1
Settexturecoordinates, 6, 0.15, 0
Settexturecoordinates, 7, 0.15, 1
Settexturecoordinates, 8, 0.20, 0
Settexturecoordinates, 9, 0.20, 1
Settexturecoordinates, 10, 0.25, 0
Settexturecoordinates, 11, 0.25, 1
Settexturecoordinates, 12, 0.30, 0
Settexturecoordinates, 13, 0.30, 1
Settexturecoordinates, 14, 0.35, 0
Settexturecoordinates, 15, 0.35, 1
Settexturecoordinates, 16, 0.40, 0
Settexturecoordinates, 17, 0.40, 1
Settexturecoordinates, 18, 0.45, 0
Settexturecoordinates, 19, 0.45, 1
Settexturecoordinates, 20, 0.50, 0
Settexturecoordinates, 21, 0.50, 1
Settexturecoordinates, 22, 0.55, 0
Settexturecoordinates, 23, 0.55, 1
Settexturecoordinates, 24, 0.60, 0
Settexturecoordinates, 25, 0.60, 1
Settexturecoordinates, 26, 0.65, 0
Settexturecoordinates, 27, 0.65, 1
Settexturecoordinates, 28, 0.70, 0
Settexturecoordinates, 29, 0.70, 1
Settexturecoordinates, 30, 0.75, 0
Settexturecoordinates, 31, 0.75, 1
Settexturecoordinates, 32, 0.80, 0
Settexturecoordinates, 33, 0.80, 1
Settexturecoordinates, 34, 0.85, 0
Settexturecoordinates, 35, 0.85, 1
Settexturecoordinates, 36, 0.90, 0
Settexturecoordinates, 37, 0.90, 1
Settexturecoordinates, 38, 0.95, 0
Settexturecoordinates, 39, 0.95, 1

CreateMeshBuilder,
Cylinder, 20, 1.0, 1.3, 0.2
Rotate, 1, 0, 0, 90
Translate, 0, 2.60, 5.60
SetColor, 141, 136, 116

CreateMeshBuilder,
Cylinder, 20, 1.0, 1.3, 0.2
Rotate, 1, 0, 0,-90
Translate, 0, 2.60,-5.60
SetColor, 141, 136, 116

CreateMeshBuilder,
Cylinder, 20, 0.4, 0.4, 0.4
Translate, 0, 3.90, 0
SetColor, 141, 136, 116

CreateMeshBuilder,
Cylinder, 20, 0.3, 0.4, 0.1
Translate, 0, 4.15, 0
SetColor, 141, 136, 116

;CreateMeshBuilder,
;Cylinder, 20, 0.1, 0.3, 0.1
;Translate, 0, 4.25, 0
;SetColor, 141, 136, 116

;Plateau

CreateMeshBuilder,
Cube, 1.40, 0.01, 1.00
Translate, 0, 3.90, 0
SetColor, 141, 136, 116

;Coté

CreateMeshBuilder,
AddVertex,-0.6, 1.48, 5.50,
AddVertex,-0.6, 1.48,-5.50,
AddVertex,-0.8, 1.25,-5.50,
AddVertex,-0.8, 1.25, 5.50,
AddFace2,0,1,2,3,
SetColor, 141, 136, 116

CreateMeshBuilder,
AddVertex,-0.6, 1.48,-5.50,
AddVertex, 0.6, 1.48,-5.50,
AddVertex, 0.8, 1.25,-5.50,
AddVertex,-0.8, 1.25,-5.50,
AddFace2,0,1,2,3,
SetColor, 141, 136, 116

CreateMeshBuilder,
AddVertex, 0.6, 1.48,-5.50,
AddVertex, 0.6, 1.48, 5.50,
AddVertex, 0.8, 1.25, 5.50,
AddVertex, 0.8, 1.25,-5.50,
AddFace2,0,1,2,3,
SetColor, 141, 136, 116

CreateMeshBuilder,
AddVertex, 0.6, 1.48, 5.50,
AddVertex,-0.6, 1.48, 5.50,
AddVertex,-0.8, 1.25, 5.50,
AddVertex, 0.8, 1.25, 5.50,
AddFace2,0,1,2,3,
SetColor, 141, 136, 116


;Avant arrière

CreateMeshBuilder,
AddVertex, 1.4, 1.25, 6.20,
AddVertex, 1.4, 0.92, 6.20,
AddVertex,-1.4, 0.92, 6.20,
AddVertex,-1.4, 1.25, 6.20,
AddFace2,0,1,2,3,
SetColor, 17,20,27

CreateMeshBuilder,
AddVertex, 1.4, 1.25,-6.20,
AddVertex, 1.4, 0.92,-6.20,
AddVertex,-1.4, 0.92,-6.20,
AddVertex,-1.4, 1.25,-6.20,
AddFace2,0,1,2,3,
SetColor, 17,20,27


;Rampe avant

CreateMeshBuilder,
Cube, 0.01, 0.45, 0.01,
Translate,-1.39, 1.70, 6.19,
SetColor, 141, 136, 116

CreateMeshBuilder,
Cube, 0.01, 0.45, 0.01,
Translate, 1.39, 1.70, 6.19,
SetColor, 141, 136, 116

CreateMeshBuilder,
Cube, 1.40, 0.01, 0.01,
Translate, 0, 2.15, 6.19,
SetColor, 141, 136, 116

CreateMeshBuilder,
Cube, 1.40, 0.01, 0.01,
Translate, 0, 1.70, 6.19,
SetColor, 141, 136, 116

;Rampe arriere

CreateMeshBuilder,
Cube, 0.01, 0.45, 0.01,
Translate,-1.39, 1.70,-6.19,
SetColor, 141, 136, 116

CreateMeshBuilder,
Cube, 0.01, 0.45, 0.01,
Translate, 1.39, 1.70,-6.19,
SetColor, 141, 136, 116

CreateMeshBuilder,
Cube, 1.40, 0.01, 0.01,
Translate, 0, 2.15,-6.19,
SetColor, 141, 136, 116

CreateMeshBuilder,
Cube, 1.40, 0.01, 0.01,
Translate, 0, 1.70,-6.19,
SetColor, 141, 136, 116

;Heurtoir Avant

;Avant gauche,
CreateMeshBuilder,
cylinder, 12, 0.12, 0.12, 0.28,
rotate, 1, 0, 0, 90,
translate,-0.80, 1.05, 6.33,
SetColor, 76, 76, 76,
GenerateNormals,

CreateMeshBuilder,
cylinder, 10, 0.10, 0.10, 0.20,
rotate, 1, 0, 0, 90,
translate,-0.80, 1.05, 6.56,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
cylinder, 20, 0.18, 0.18, 0.02,
rotate,1,0,0,90,
translate,-0.89, 1.05, 6.66,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
Cube, 0.18, 0.01, 0.18,
Rotate, 1, 0, 0, 90,
Translate,-0.71, 1.05, 6.66,
SetColor, 66, 66, 66,

;Avant droite,
CreateMeshBuilder,
cylinder, 10, 0.12, 0.12, 0.28,
rotate, 1, 0, 0, 90,
translate, 0.80, 1.05, 6.33,
SetColor, 76, 76, 76,
GenerateNormals,

CreateMeshBuilder,
cylinder,10, 0.10, 0.10, 0.20,
rotate, 1, 0, 0, 90,
translate, 0.80,1.05, 6.56,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
cylinder, 20, 0.18, 0.18, 0.02,
rotate, 1, 0, 0,90,
translate, 0.89, 1.05, 6.66,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
Cube, 0.18, 0.01, 0.18,
Rotate, 1, 0, 0, 90,
Translate, 0.71, 1.05, 6.66,
SetColor, 66, 66, 66,


;Heurtoir Arrière

;Arrière gauche,
CreateMeshBuilder,
cylinder, 10, 0.12, 0.12, 0.28,
rotate,1,0,0,90,
translate,-0.80, 1.05,-6.33,
SetColor, 76, 76, 76,
GenerateNormals,

CreateMeshBuilder,
cylinder, 10, 0.10, 0.10, 0.2,
rotate,1,0,0,90,
translate,-0.80, 1.05,-6.56,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
cylinder, 20, 0.18, 0.18, 0.02,
rotate, 1, 0, 0, 90,
translate,-0.89, 1.05,-6.66,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
Cube, 0.18, 0.01, 0.18,
Rotate, 1, 0, 0, 90,
Translate,-0.71, 1.05,-6.66,
SetColor, 66, 66, 66,

;Arrière droite
CreateMeshBuilder,
cylinder, 10, 0.12, 0.12, 0.28,
rotate, 1, 0, 0, 90,
translate, 0.80, 1.05,-6.33,
SetColor, 76, 76, 76,
GenerateNormals,

CreateMeshBuilder,
cylinder, 10, 0.10, 0.10, 0.20,
rotate, 1, 0, 0, 90,
translate, 0.80, 1.05,-6.56,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
cylinder, 30, 0.18, 0.18, 0.02,
rotate, 1, 0, 0, 90,
translate, 0.89, 1.05,-6.66,
SetColor, 66, 66, 66,
GenerateNormals,

CreateMeshBuilder,
Cube, 0.18, 0.01, 0.18,
Rotate, 1, 0, 0, 90,
Translate, 0.71, 1.05,-6.66,
SetColor, 66, 66, 66,

;Screw coupling etc

CreateMeshBuilder,
AddVertex,-0.40, 0.200, 5.80, 
AddVertex,-0.40, 1.035, 5.80,
AddVertex, 0.25, 1.035, 7.80, 
AddVertex, 0.25, 0.200, 7.80, 
AddFace2,0,1,2,3,  

LoadTexture,airpipes.png,
SetTextureCoordinates,0, 0, 1,
SetTextureCoordinates,1, 0, 0,
SetTextureCoordinates,2, 1, 0,
SetTextureCoordinates,3, 1, 1,
SetDecalTransparentColor,0,0,255,


