;(c) Joao Carlos Goncalves; May 2009
;http://www.bvebrasil.com.br
;Trainset for Open BVE
;EMU class 2100 from CPTM; built by CAF; Spain
 

;;;;;right side
CreateMeshBuilder,
AddVertex, -0.95, 3.26,  9.90,  
AddVertex, -0.95, 3.26, -15.70, 
AddVertex, -1.25, 3.26,  9.90,  
AddVertex, -1.25, 3.26, -15.70, 
AddVertex, -1.41, 3.07,  9.90,  
AddVertex, -1.41, 3.07, -15.70, 
AddVertex, -1.41, 0.37,  9.90,  
AddVertex, -1.41, 0.37, -15.70, 
AddFace2, 0,1,3,2,
AddFace2, 2,3,5,4,
AddFace2, 4,5,7,6,
SetColor, 150,150,150,
LoadTexture, 2127mc_sideR.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,0,0.03,
SetTextureCoordinates, 3,1,0.03,
SetTextureCoordinates, 4,0,0.06,
SetTextureCoordinates, 5,1,0.06,
SetTextureCoordinates, 6,0,1,
SetTextureCoordinates, 7,1,1,
SetDecalTransparentColor,  0, 255, 0,

;;;;;left side
CreateMeshBuilder,
AddVertex, 0.95, 3.26, -15.70,
AddVertex, 0.95, 3.26, 9.90,
AddVertex, 1.25, 3.26, -15.70,
AddVertex, 1.25, 3.26, 9.90,
AddVertex, 1.41, 3.07, -15.70,
AddVertex, 1.41, 3.07, 9.90,
AddVertex, 1.41, 0.37, -15.70,
AddVertex, 1.41, 0.37, 9.90,
AddFace2, 0,1,3,2,
AddFace2, 2,3,5,4,
AddFace2, 4,5,7,6,
SetColor, 140,140,140,
GenerateNormals,
LoadTexture, 2127mc_sideL.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,0,0.03,
SetTextureCoordinates, 3,1,0.03,
SetTextureCoordinates, 4,0,0.06,
SetTextureCoordinates, 5,1,0.06,
SetTextureCoordinates, 6,0,1,
SetTextureCoordinates, 7,1,1,
SetDecalTransparentColor,  0, 255, 0,


;;;;;inside;;left;;;
CreateMeshBuilder,
AddVertex, -0.88, 3.22,  9.90,
AddVertex, -0.88, 3.22, -15.66
AddVertex, -1.18, 3.22,  9.90,
AddVertex, -1.18, 3.22, -15.66
AddVertex, -1.36, 3.03,  9.90,
AddVertex, -1.36, 3.03, -15.66
AddVertex, -1.36, 0.94,  9.90,
AddVertex, -1.36, 0.94, -15.66,
AddFace, 3,2,1,0,
AddFace, 4,5,3,2,
AddFace, 6,7,5,4,
SetColor, 120,120,50,
GenerateNormals,
GenerateNormals,
LoadTexture, 2100_intR.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,-1,0,
SetTextureCoordinates, 2,0,0.06,
SetTextureCoordinates, 3,-1,0.06,
SetTextureCoordinates, 4,0,0.11,
SetTextureCoordinates, 5,-1,0.11,
SetTextureCoordinates, 6,0,1,
SetTextureCoordinates, 7,-1,1,
SetDecalTransparentColor, 0,255,0,
SetEmissiveColor, 120,120,120,

;;;inside;;right
CreateMeshBuilder,
AddVertex, 0.88, 3.22,  9.90,
AddVertex, 0.88, 3.22, -15.66,
AddVertex, 1.18, 3.22,  9.90,
AddVertex, 1.18, 3.22, -15.66,
AddVertex, 1.36, 3.03,  9.90,
AddVertex, 1.36, 3.03, -15.66,
AddVertex, 1.36, 0.94,  9.90,
AddVertex, 1.36, 0.94, -15.66,
AddFace, 0,1,3,2,
AddFace, 2,3,5,4,
AddFace, 4,5,7,6,
SetColor, 120,120,50,
GenerateNormals,
GenerateNormals,
LoadTexture, 2100_intL.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,0,0.04,
SetTextureCoordinates, 3,1,0.04,
SetTextureCoordinates, 4,0,0.09,
SetTextureCoordinates, 5,1,0.09,
SetTextureCoordinates, 6,0,1,
SetTextureCoordinates, 7,1,1,
SetDecalTransparentColor, 0,255,0,
SetEmissiveColor, 120,120,120,



;;;;;front
CreateMeshBuilder,
AddVertex, -1.44, 3.37, -15.70,
AddVertex,  1.44, 3.37, -15.70,
AddVertex,  1.44, 3.15, -15.70,
AddVertex, -1.44, 3.15, -15.70,
AddVertex, -1.44, 0.15, -15.70,
AddVertex,  1.44, 0.15, -15.70,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
SetColor, 175,176,177,
GenerateNormals,
LoadTexture, 2100front_g.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,0.07,
SetTextureCoordinates, 3,0,0.07,
SetTextureCoordinates, 4,0,1,
SetTextureCoordinates, 5,1,1,
SetDecalTransparentColor, 0,0,255,


;;glass windshield
CreateMeshBuilder,
AddVertex, -1.34, 3.05, -15.65,
AddVertex,  1.34, 3.05, -15.65,
AddVertex,  1.34, 3.00, -15.65,
AddVertex, -1.34, 3.00, -15.65,
AddVertex, -1.34, 0.75, -15.65,
AddVertex,  1.34, 0.75, -15.65,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
SetColor, 120,120,120,140,
GenerateNormals,


;;;inner 
CreateMeshBuilder,
AddVertex,  1.40, 3.18, -13.00,
AddVertex, -1.40, 3.18, -13.00,
AddVertex, -1.40, 2.96, -13.00,
AddVertex,  1.40, 2.96, -13.00,
AddVertex,  1.40, 0.85, -13.00,
AddVertex, -1.40, 0.85, -13.00,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
SetColor, 120,120,50,
GenerateNormals,
LoadTexture, 2100_innerF.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,0.17,
SetTextureCoordinates, 3,0,0.17,
SetTextureCoordinates, 4,0,1,
SetTextureCoordinates, 5,1,1,
SetDecalTransparentColor, 0,0,255,
SetEmissiveColor, 120,120,125,


;;engineer cab
CreateMeshBuilder,
AddVertex,  1.40, 3.18, -14.10,
AddVertex, -1.40, 3.18, -14.10,
AddVertex, -1.40, 2.96, -14.10,
AddVertex,  1.40, 2.96, -14.10,
AddVertex,  1.40, 1.00, -14.10,
AddVertex, -1.40, 1.00, -14.10,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
SetColor, 120,120,120,
GenerateNormals,
LoadTexture, 2100_innerD.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,-1,0,
SetTextureCoordinates, 2,-1,0.17,
SetTextureCoordinates, 3,0,0.17,
SetTextureCoordinates, 4,0,1,
SetTextureCoordinates, 5,-1,1,
SetDecalTransparentColor, 0,0,255,
SetEmissiveColor, 118,118,118,

;;;;;rear=============
CreateMeshBuilder,
AddVertex,  1.45, 3.28, 9.90,
AddVertex, -1.45, 3.28, 9.90,
AddVertex, -1.45, 3.03, 9.90,
AddVertex,  1.45, 3.03, 9.90,
AddVertex,  1.45, 0.45, 9.90,
AddVertex, -1.45, 0.45, 9.90,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
SetColor, 110,110,110,
GenerateNormals,
LoadTexture, 1400rear.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,0.17,
SetTextureCoordinates, 3,0,0.17,
SetTextureCoordinates, 4,0,1,
SetTextureCoordinates, 5,1,1,
SetDecalTransparentColor, 0,0,255,

;;;inner rear
CreateMeshBuilder,
AddVertex,  1.340, 3.25, 9.70,
AddVertex, -1.340, 3.25, 9.70,
AddVertex, -1.340, 3.03, 9.70,
AddVertex,  1.340, 3.03, 9.70,
AddVertex,  1.340, 0.85, 9.70,
AddVertex, -1.340, 0.85, 9.70,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
SetColor, 120,120,50,
GenerateNormals,
LoadTexture, 2100_innerB.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,-1,0,
SetTextureCoordinates, 2,-1,0.11,
SetTextureCoordinates, 3,0,0.11,
SetTextureCoordinates, 4,0,1,
SetTextureCoordinates, 5,-1,1,
SetDecalTransparentColor, 0,0,255,
SetEmissiveColor, 120,120,120,

;;;;;underframe==========
CreateMeshBuilder,
AddVertex, -0.68,  1.00, 4.75,
AddVertex, -0.68,  1.00, -10.75,
AddVertex, -0.68, -0.20, -10.75,
AddVertex, -0.68, -0.20, 4.75,
AddFace2, 0,1,2,3,
GenerateNormals,
LoadTexture, under.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,

CreateMeshBuilder,
AddVertex, 0.68,  1.00,  4.75,
AddVertex, 0.68,  1.00, -10.75,
AddVertex, 0.68, -0.20, -10.75,
AddVertex, 0.68, -0.20,  4.75,
AddFace2, 0,1,2,3,
GenerateNormals,
LoadTexture, under.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,


;;;;;couplers
CreateMeshBuilder,
AddVertex, -1.0, 1.0, -14.675,
AddVertex,  1.0, 1.0, -14.675,
AddVertex,  1.0, 0.1, -14.675,
AddVertex, -1.0, 0.1, -14.675,
AddFace2, 0,1,2,3,
GenerateNormals,
LoadTexture, coupler3.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,

CreateMeshBuilder,
AddVertex, -1.0, 1.0, 8.675,
AddVertex,  1.0, 1.0, 8.675,
AddVertex,  1.0, 0.1, 8.675,
AddVertex, -1.0, 0.1, 8.675,
AddFace2, 0,1,2,3,
GenerateNormals,
LoadTexture, coupler3.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,


;;;;;outer ceiling========
CreateMeshBuilder,
AddVertex,  1.24, 3.25, 9.90,
AddVertex,  1.24, 3.25 -15.70,
AddVertex,  1.24, 3.25, -15.70,
AddVertex,  1.24, 3.25, 9.90,
AddVertex, -1.24, 3.25, 9.90,
AddVertex, -1.24, 3.25, -15.70,
AddVertex, -1.24, 3.25, -15.70,
AddVertex, -1.24, 3.25, 9.90,
AddFace2, 0,1,2,3,
AddFace2, 3,2,5,4,
AddFace2, 4,5,6,7,
SetColor, 10,10,68,
GenerateNormals,



;;;;;internal lamps for saloon;;;;;
CreateMeshBuilder,
Cube, 0.06, 0.04, 3.17000000031,
Translate, 0.4300, 3.2000, -12.300,
rotate, 90,0,90,0,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,4,

;;;for the doors; near vents
CreateMeshBuilder,
Cube, 0.15, 0.04, 0.52000000052,
Translate, 7.1600, 3.2000, 0.0000,
Rotate, 0,90,0,90,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,
;;;
CreateMeshBuilder,
Cube, 0.15, 0.04, 0.52000000052,
Translate, 8.2300, 3.2000, 0.0000,
Rotate, 0,90,0,90,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,
;;;
CreateMeshBuilder,
Cube, 0.15, 0.04, 0.52000000052,
Translate, -1.2700, 3.2000, 0.0000,
Rotate, 0,90,0,90,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,
;;;
CreateMeshBuilder,
Cube, 0.15, 0.04, 0.52000000052,
Translate, -2.3500, 3.2000, 0.0000,
Rotate, 0,90,0,90,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,


;;;
CreateMeshBuilder,
Cube, 0.06, 0.04, 3.3000000030,
Translate, 0.4300, 3.2000, -2.96000000,
rotate, 90,0,90,0,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,4,
;;;
CreateMeshBuilder,
Cube, 0.06, 0.04, 1.78000000018,
Translate, 0.4300, 3.2000, 5.00000,
rotate, 90,0,90,0,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,



;;;;;internal lamps; left;;;;;
CreateMeshBuilder,
Cube, 0.06, 0.04, 3.17000000030,
Translate, -0.4300, 3.2000, -12.300,
rotate, 90,0,90,0,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,
;;;
CreateMeshBuilder,
Cube, 0.06, 0.04, 3.30000000030,
Translate, -0.4300, 3.2000, -2.96000,
Rotate, 90,0,90,0,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,
;;;
CreateMeshBuilder,
Cube, 0.06, 0.04, 1.78000000018,
Translate, -0.4300, 3.2000, 5.000,
rotate, 90,0,90,0,
SetColor, 0,0,0,
SetEmissiveColor, 250,250,250,
SetBlendMode,Additive,6,




;;;;;floor
CreateMeshBuilder,
addVertex,  1.40, 1.02, 9.90,
addVertex, -1.40, 1.02, 9.90,
addVertex, -1.40, 1.02, -15.70,
addVertex,  1.40, 1.02, -15.70,
addFace2, 0,1,2,3,
SetColor, 230,240,250,
LoadTexture, pdr_floor.bmp,
SetTextureCoordinates, 0,0,1,
SetTextureCoordinates, 1,0,0,
SetTextureCoordinates, 2,1,0,
SetTextureCoordinates, 3,1,1,

;;;;;floor shade===== 
CreateMeshBuilder,
AddVertex,  1.469, -0.124, 9.700,
AddVertex,  1.469, -0.124, -14.500,
AddVertex,  1.469, -0.124, -14.500,
AddVertex,  1.469, -0.124, 9.700,
AddVertex, -1.469, -0.124, 9.700,
AddVertex, -1.469, -0.124, -14.500,
AddVertex, -1.469, -0.124, -14.500,
AddVertex, -1.469, -0.124, 9.700,
AddFace, 0,1,2,3,
AddFace, 3,2,5,4,
AddFace, 4,5,6,7,
SetColor, 60,70,70,140,



;;;;bogies R
CreateMeshBuilder,
AddVertex, 0.878, 0.90, 7.5,
AddVertex, 0.878, 0.90, 3.5,
AddVertex, 0.878, 0.20, 3.5,
AddVertex, 0.878, 0.20, 7.5,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, bogies.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,
;;;
CreateMeshBuilder,
AddVertex, 0.878, 0.90, -13.5,
AddVertex, 0.878, 0.90, -9.5,
AddVertex, 0.878, 0.20, -9.5,
AddVertex, 0.878, 0.20, -13.5,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, bogies.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,


;;;;;bogies L==============
CreateMeshBuilder,
AddVertex, -0.878, 0.90, 7.50,
AddVertex, -0.878, 0.90, 3.50,
AddVertex, -0.878, 0.20, 3.50,
AddVertex, -0.878, 0.20, 7.50,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, bogies.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,
;;;
CreateMeshBuilder,
AddVertex, -0.878, 0.90, -13.50,
AddVertex, -0.878, 0.90, -9.50,
AddVertex, -0.878, 0.20, -9.50,
AddVertex, -0.878, 0.20, -13.50,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, bogies.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,



;;;;;wheels
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, -0.73500073, 4.05000078
Rotate, 0,0,90,90,
;;rearR
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, 0.73500073, 4.05000078
Rotate, 0,0,90,90,
;;axle
CreateMeshBuilder,
Cylinder, 6, 0.078, 0.078, -1.7000000075
SetColor, 75,40,40,
Translate, 0.47000037, -0.0000000, 4.05000078
Rotate, 0,0,90,90,


;;;;;
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, -0.73500073, 6.950000078
Rotate, 0,0,90,90,
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, 0.73500073, 6.950000078
Rotate, 0,0,90,90,
;;axle
CreateMeshBuilder,
Cylinder, 6, 0.078, 0.078, -1.7000000075
SetColor, 75,40,40,
Translate, 0.47000037, -0.0000000, 6.950000078
Rotate, 0,0,90,90,



;;;;;;;;;
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, -0.73500073, -10.06000078
Rotate, 0,0,90,90,
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, 0.73500073, -10.06000078
Rotate, 0,0,90,90,
;;axle
CreateMeshBuilder,
Cylinder, 6, 0.078, 0.078, -1.7000000075
SetColor, 75,40,40,
Translate, 0.47000037, -0.0000000, -10.06000078
Rotate, 0,0,90,90,


;;;;
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, -0.73500073, -12.95000078
Rotate, 0,0,90,90,
;;rearR
CreateMeshBuilder,
Cylinder, 18, 0.48, 0.48, -0.100002
SetColor, 15,5,20,
Translate, 0.4700034, 0.73500073, -12.95000078
Rotate, 0,0,90,90,
;;axle
CreateMeshBuilder,
Cylinder, 6, 0.078, 0.078, -1.7000000075
SetColor, 75,40,40,
Translate, 0.47000037, -0.0000000, -12.95000078
Rotate, 0,0,90,90,



;;;;;pantograph Faiveley type==============
;;;up
CreateMeshBuilder,
AddVertex, -0.650, 5.000, -11.950,
addVertex,  0.650, 5.000, -11.950,
addVertex,  0.650, 4.250, -13.600,
addVertex, -0.650, 4.250, -13.600,
AddFace2, 0,1,2,3,
setColor, 222,227,225,
LoadTexture, panto_up.bmp,
SetTextureCoordinates, 0,0,1,
SetTextureCoordinates, 1,0,0,
SetTextureCoordinates, 2,1,0,
SetTextureCoordinates, 3,1,1,
SetDecalTransparentColor, 0,0,255,


;;;;;base=========
CreateMeshbuilder,
cylinder, 6, 0.07, 0.07, 1.8500000175
translate, 0.00, -12.8200000742, 3.850000415 ;W;L;H;+low   
rotate, 123,0,0,123
setcolor, 145,36,36
;;//####
CreateMeshbuilder,
cylinder, 6, 0.04, 0.04, 1.8500000185
translate, 0.00, -12.7200000722, 3.700000400    
rotate, 123,0,0,123
setcolor, 145,36,36


;;;;;---1st
CreateMeshbuilder,
cylinder, 6, 0.06, 0.06, 0.37000075
translate, 4.240000423, 0.00, -13.600001356  ;H;W;L;   
rotate, 0,0,90,90
setcolor, 145,35,36

;;;---2nd
CreateMeshbuilder,
cylinder, 6, 0.04, 0.04, 0.390000039
translate, 4.310000429, 0.00, -13.430001343   
rotate, 0,0,90,90
setcolor, 147,37,45


;;;;;collector======
CreateMeshBuilder,
AddVertex, -1.10, 4.80, -11.95,
AddVertex, -1.10, 4.80, -11.70,
AddVertex, -0.70, 5.00, -11.70,
AddVertex, -0.70, 5.00, -11.95,
AddVertex,  1.10, 4.80, -11.95,
AddVertex,  1.10, 4.80, -11.70,
AddVertex,  0.70, 5.00, -11.70,
AddVertex,  0.70, 5.00, -11.95,
AddFace2, 0,1,2,3,
AddFace2, 7,6,5,4,
AddFace2, 6,7,3,2,
SetColor, 80,80,80,




;;;passengers
CreateMeshBuilder,
AddVertex, -0.78, 2.7,  7,
AddVertex, -0.78, 2.7, -12,
AddVertex, -0.78, 1.0, -12,
AddVertex, -0.78, 1.0,  7,
AddFace2, 0,1,2,3,
GenerateNormals,
LoadTexture, passag.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,5,0,
SetTextureCoordinates, 2,5,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,
;;;;;
CreateMeshBuilder,
AddVertex, 0.78, 2.7,  8,
AddVertex, 0.78, 2.7, -13,
AddVertex, 0.78, 1.0, -13,
AddVertex, 0.78, 1.0,  8,
AddFace2, 0,1,2,3,
GenerateNormals,
LoadTexture, passag.bmp,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,5,0,
SetTextureCoordinates, 2,5,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,

;;;inner ceiling
CreateMeshBuilder,
addVertex,  1.20, 3.20, 9.90,
addVertex, -1.20, 3.20, 9.90,
addVertex, -1.20, 3.20, -15.68,
addVertex,  1.20, 3.20, -15.68,
addFace2, 0,1,2,3,
SetColor, 130,130,50,
LoadTexture, ceiling2123.png,
SetTextureCoordinates, 0,0,1,
SetTextureCoordinates, 1,0,0,
SetTextureCoordinates, 2,1,0,
SetTextureCoordinates, 3,1,1,
SetEmissiveColor, 140,140,130,

;;upper ceiling, outer
CreateMeshBuilder,
AddVertex, 1.235, 3.60, 8.25,
AddVertex, 1.235, 3.60, -14.50,
AddVertex, 1.235, 3.20, -14.50,
AddVertex, 1.235, 3.20, 8.25,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, 2100mce.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,
;;;;;
CreateMeshBuilder,
AddVertex, -1.235, 3.60, 8.25,
AddVertex, -1.235, 3.60, -14.50,
AddVertex, -1.235, 3.20, -14.50,
AddVertex, -1.235, 3.20, 8.25,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, 2100mce.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 0,0,255,

;;;;;upper cooler, inner
CreateMeshBuilder,
AddVertex, 0.925, 3.95, 5.25,
AddVertex, 0.925, 3.95, -11.00,
AddVertex, 0.925, 3.30, -11.00,
AddVertex, 0.925, 3.30, 5.25,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, 2100mcg.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 255,255,255,
;;;;;
CreateMeshBuilder,
AddVertex, -0.925, 3.95, 5.25,
AddVertex, -0.925, 3.95, -11.00,
AddVertex, -0.925, 3.30, -11.00,
AddVertex, -0.925, 3.30, 5.25,
AddFace2,  0,1,2,3,
GenerateNormals,
LoadTexture, 2100mcg.png,
SetTextureCoordinates, 0,0,0,
SetTextureCoordinates, 1,1,0,
SetTextureCoordinates, 2,1,1,
SetTextureCoordinates, 3,0,1,
SetDecalTransparentColor, 255,255,255,

;;;;glasses left
CreateMeshBuilder,
AddVertex, -1.38, 3.00, 9.9,
AddVertex, -1.38, 3.00, 3.5,
AddVertex, -1.38, 1.00, 3.5,
AddVertex, -1.38, 1.00, 9.9,
AddFace2, 0,1,2,3,
SetColor, 80,82,82,132
GenerateNormals,
;;
CreateMeshBuilder,
AddVertex, -1.38, 3.00, 0.4,
AddVertex, -1.38, 3.00, -6.0,
AddVertex, -1.38, 1.00, -6.0,
AddVertex, -1.38, 1.00, 0.4,
AddFace2, 0,1,2,3,
SetColor, 80,82,82,132
GenerateNormals,
;;;##
CreateMeshBuilder,
AddVertex, -1.38, 3.00, -9.3,
AddVertex, -1.38, 3.00, -15.7,
AddVertex, -1.38, 1.00, -15.7,
AddVertex, -1.38, 1.00, -9.3,
AddFace2, 0,1,2,3,
SetColor, 80,82,82,132
GenerateNormals,



;;;;glasses right
CreateMeshBuilder,
AddVertex, 1.38, 3.00, 9.9,
AddVertex, 1.38, 3.00, 3.5,
AddVertex, 1.38, 1.00, 3.5,
AddVertex, 1.38, 1.00, 9.9,
AddFace2, 0,1,2,3,
SetColor, 80,82,82,132
GenerateNormals,
;;
CreateMeshBuilder,
AddVertex, 1.38, 3.00, 0.4,
AddVertex, 1.38, 3.00, -6.0,
AddVertex, 1.38, 1.00, -6.0,
AddVertex, 1.38, 1.00, 0.4,
AddFace2, 0,1,2,3,
SetColor, 80,82,82,132
GenerateNormals,
;;;##
CreateMeshBuilder,
AddVertex, 1.38, 3.00, -9.3,
AddVertex, 1.38, 3.00, -15.7,
AddVertex, 1.38, 1.00, -15.7,
AddVertex, 1.38, 1.00, -9.3,
AddFace2, 0,1,2,3,
SetColor, 80,82,82,132
GenerateNormals,



;;;tail lights;;;
CreateMeshBuilder,
AddVertex, -1.19, 3.14, -15.71,
AddVertex, -1.19, 3.01, -15.71,
AddVertex, -1.05, 3.01, -15.71,
AddVertex, -1.05, 3.14, -15.71,
AddFace2, 0,1,2,3,
SetColor, 0,0,0,
GenerateNormals,
LoadTexture, light_red.bmp,
SetTextureCoordinates, 0,0,1,
SetTextureCoordinates, 1,0,0,
SetTextureCoordinates, 2,1,0,
SetTextureCoordinates, 3,1,1,
SetEmissiveColor, 255,0,0,
SetBlendMode,Additive,40,DivideExponent2
;;
CreateMeshBuilder,
AddVertex, 1.16, 3.17, -15.71,
AddVertex, 1.16, 3.03, -15.71,
AddVertex, 1.02, 3.03, -15.71,
AddVertex, 1.02, 3.17, -15.71,
AddFace2, 0,1,2,3,
SetColor, 0,0,0,
GenerateNormals,
LoadTexture, light_red.bmp,
SetTextureCoordinates, 0,0,1,
SetTextureCoordinates, 1,0,0,
SetTextureCoordinates, 2,1,0,
SetTextureCoordinates, 3,1,1,
SetEmissiveColor, 255,0,0,
SetBlendMode,Additive,40,DivideExponent2


;;;;;side pilot lamps
CreateMeshBuilder,
Cylinder, 12, 0.028, 0.028, 0.25000      
SetColor, 0,0,0,
Translate, 1.450, -2.78000, -2.8200 ;W;L;Height;
Rotate, 90,0,0,90,
SetEmissiveColor, 255,0,0,
;;;
CreateMeshBuilder,
Cube, 0.06, 0.09, 0.091000009,
Translate, 1.440, 2.7800, -2.78000, ;W;H;Length; 
rotate, 90,0,90,0,
SetColor, 100,100,110,



CreateMeshBuilder,
Cylinder, 12, 0.028, 0.028, 0.25000       
SetColor, 0,0,0,
Translate, -1.450, -2.780000, -2.820000 
Rotate, 90,0,0,90,
SetEmissiveColor, 254,0,0,
;;;
CreateMeshBuilder,
Cube, 0.06, 0.09, 0.091000009,
Translate, -1.440, 2.78000, -2.780000,  
rotate, 90,0,90,0,
SetColor, 100,100,110,


