Sub Color_Model() Dim i As Long, j As Long, k As Long Dim U As Single, V As Single, W As Single Dim X As Single, Y As Single, Z As Single Dim BLK As XYZ32, GRY As XYZ32, WHT As XYZ32 ' Space Plane Dimensions & Axial Range ' Length = 60.000 m : 30.000 > X > -30.000 ' Width = 30.025 m : 15.013 > Y > -15.013 ' Height = 7.770 m : 3.885 > Z > -3.885 If Model.NmbFac < 1 Then Exit Sub On Error Resume Next BLK.X = 0.15!: BLK.Y = 0.15!: BLK.Z = 0.15! GRY.X = 0.35!: GRY.Y = 0.35!: GRY.Z = 0.35! WHT.X = 0.85!: WHT.Y = 0.85!: WHT.Z = 0.85! With Model For i = 0 To .NmbFac - 1 .Colour(i) = WHT ' facet normal U = .Facet(i).V(0).X V = .Facet(i).V(0).Y W = .Facet(i).V(0).Z ' facet center X = MLth / 240 * .Center(i).X Y = MLth / 240 * .Center(i).Y Z = MLth / 240 * .Center(i).Z ' leading edge If X > (25 - 11 / 45 * Y * Y) Then .Colour(i) = BLK ' under-belly If W < 0.3 And Z < -2.7 Then .Colour(i) = BLK ' main exhaust If X < -25.1 Then If (Y / 3.6) ^ 2 + ((Z + 0.03) / 2.58) ^ 2 < 1.05 Then .Colour(i) = GRY End If ' small nozzles If X < -28.2 Then If (Y - 4.56) ^ 2 + (Z + 1.4) ^ 2 < 1.25 ^ 2 Then .Colour(i) = GRY If (Y + 4.56) ^ 2 + (Z + 1.4) ^ 2 < 1.25 ^ 2 Then .Colour(i) = GRY End If ' rear face If X < -25.1 And U < -0.9 Then .Colour(i) = BLK ' front windows If X > 0 And Y ^ 2 + 9 * (Z - 1.5) ^ 2 < 0.4 ^ 2 Then .Colour(i) = BLK If (X - 6.5) ^ 2 + (Z - 1.15) ^ 2 < 0.275 ^ 2 Then .Colour(i) = BLK ' side windows If (X - 3.5) ^ 2 + (Z - 1) ^ 2 < 0.3 ^ 2 Then .Colour(i) = BLK If (X - 1.5) ^ 2 + (Z - 1) ^ 2 < 0.3 ^ 2 Then .Colour(i) = BLK If (X + 0.5) ^ 2 + (Z - 1) ^ 2 < 0.3 ^ 2 Then .Colour(i) = BLK If (X + 2.5) ^ 2 + (Z - 1) ^ 2 < 0.3 ^ 2 Then .Colour(i) = BLK If (X + 4.5) ^ 2 + (Z - 1) ^ 2 < 0.3 ^ 2 Then .Colour(i) = BLK ' cargo bay If X > -16 And X < -7 And Abs(Y) < 0.05 Then .Colour(i) = BLK If X > -16 And X < -7 And Abs(Z) < 0.05 Then .Colour(i) = BLK If Z > 0 And Abs(X + 16) < 0.05 Then .Colour(i) = BLK If Z > 0 And Abs(X + 7) < 0.05 Then .Colour(i) = BLK ' elevons If X < -26.5 And Abs(Y - (7.5 - (X + 26.5) / 7)) < 0.09 Then .Colour(i) = BLK If X < -26.5 And Abs(Y + (7.5 - (X + 26.5) / 7)) < 0.09 Then .Colour(i) = BLK If Y < -7.5 And Abs(X + 26.5) < 0.09 Then .Colour(i) = BLK If Y > 7.5 And Abs(X + 26.5) < 0.09 Then .Colour(i) = BLK If W < -0.8 Then If X < -26.5 And Abs(Y - (7.5 - (X + 26.5) / 7)) < 0.05 Then .Colour(i) = GRY If X < -26.5 And Abs(Y + (7.5 - (X + 26.5) / 7)) < 0.05 Then .Colour(i) = GRY If Y < -7.5 And Abs(X + 26.5) < 0.05 Then .Colour(i) = GRY If Y > 7.5 And Abs(X + 26.5) < 0.05 Then .Colour(i) = GRY End If ' rudders If X < -23 And X > -26.5 And Abs(Y) > 4 And Abs(Z - 1) < 0.07 Then .Colour(i) = BLK If X < -23 And X > -26.5 And Abs(Y) > 4 And Abs(Z + 1) < 0.07 Then .Colour(i) = BLK If Z > -1 And Z < 1 And Abs(Y) > 4 And Abs(X + 26.5) < 0.07 Then .Colour(i) = BLK If Z > -1 And Z < 1 And Abs(Y) > 4 And Abs(X + 23) < 0.07 Then .Colour(i) = BLK ' landing gear If W < -0.8 Then ' left If X > -19 And X < -14 And Abs(Y - 8) < 0.05 Then .Colour(i) = GRY If X > -19 And X < -14 And Abs(Y - 6.5) < 0.05 Then .Colour(i) = GRY If X > -19 And X < -14 And Abs(Y - 5) < 0.05 Then .Colour(i) = GRY If Y > 5 And Y < 8 And Abs(X + 14) < 0.05 Then .Colour(i) = GRY If Y > 5 And Y < 8 And Abs(X + 19) < 0.05 Then .Colour(i) = GRY ' right If X > -19 And X < -14 And Abs(Y + 8) < 0.05 Then .Colour(i) = GRY If X > -19 And X < -14 And Abs(Y + 6.5) < 0.05 Then .Colour(i) = GRY If X > -19 And X < -14 And Abs(Y + 5) < 0.05 Then .Colour(i) = GRY If Y > -8 And Y < -5 And Abs(X + 14) < 0.05 Then .Colour(i) = GRY If Y > -8 And Y < -5 And Abs(X + 19) < 0.05 Then .Colour(i) = GRY ' nose If X > 12 And X < 17 And Abs(Y) < 0.05 Then .Colour(i) = GRY If X > 12 And X < 17 And Abs(Y - 1) < 0.05 Then .Colour(i) = GRY If X > 12 And X < 17 And Abs(Y + 1) < 0.05 Then .Colour(i) = GRY If Y > -1 And Y < 1 And Abs(X - 12) < 0.05 Then .Colour(i) = GRY If Y > -1 And Y < 1 And Abs(X - 17) < 0.05 Then .Colour(i) = GRY End If ' retractable air intake If W < -0.8 Then If X > -11 And X < -3 And Abs(Y + 5) < 0.05 Then .Colour(i) = GRY If X > -11 And X < -3 And Abs(Y - 5) < 0.05 Then .Colour(i) = GRY If Y > -5 And Y < 5 And Abs(X + 11) < 0.05 Then .Colour(i) = GRY If Y > -5 And Y < 5 And Abs(X + 3) < 0.05 Then .Colour(i) = GRY End If ' crew & passenger access hatch If W < -0.8 Then If Abs((X - 4) ^ 2 + Y ^ 2 - 0.75 ^ 2) < 0.05 Then .Colour(i) = GRY End If Next i End With frmMain.chkColor.Caption = "Grayscale Facets" Status = 1 End Sub