Guest User

Create Event

a guest
Sep 26th, 2016
46
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. init_3D_vars();
  2. sxt[0] = 0;
  3. sxt[1] = 0;
  4. sxt[2] = 0;
  5. syt[0] = 0;
  6. syt[1] = 0;
  7. syt[2] = 0;
  8. global.surid = 0;
  9. global.surid = surface_create(view_wport,view_hport);
  10.  
  11. Ex = view_wport/2;
  12. Ey = view_hport/2;
  13. Ez = 1500; //(could be anything > 1)
  14.  
  15. count = 0;
  16. a = 0;
  17. b = 0;
  18. c = 0;
  19. m = 0;
  20. n = 0;
  21. coly = c_red;
  22. tempz = 0;
  23.  
  24. //1-4 are lower half
  25. object_x[0,0] = 25;
  26. object_y[0,0] = -25;
  27. object_z[0,0] = -25;
  28. object_x[0,1] = -25;
  29. object_y[0,1] = -25;
  30. object_z[0,1] = -25;
  31. object_x[0,2] = -25;
  32. object_y[0,2] = -25;
  33. object_z[0,2] = 25;
  34. object_x[0,3] = 25;
  35. object_y[0,3] = -25;
  36. object_z[0,3] = 25;
  37. //5-8 are upper half
  38. object_x[0,4] = 25;
  39. object_y[0,4] = 25;
  40. object_z[0,4] = -25;
  41. object_x[0,5] = -25;
  42. object_y[0,5] = 25;
  43. object_z[0,5] = -25;
  44. object_x[0,6] = -25;
  45. object_y[0,6] = 25;
  46. object_z[0,6] = 25;
  47. object_x[0,7] = 25;
  48. object_y[0,7] = 25;
  49. object_z[0,7] = 25;
  50. object_vertices[0] = 8;
  51. //to conclude this has 8 vertices
  52. ref_max[0] = 12;
  53. //the object has 12 triangles
  54.  
  55. //polygon 1,2,3 (don't forget to -1 these numbers)
  56. ref_x1[0,0] = 0;
  57. ref_y1[0,0] = 0;
  58. ref_z1[0,0] = 0;
  59. ref_x2[0,0] = 1;
  60. ref_y2[0,0] = 1;
  61. ref_z2[0,0] = 1;
  62. ref_x3[0,0] = 2;
  63. ref_y3[0,0] = 2;
  64. ref_z3[0,0] = 2;
  65.  
  66. //polygon 1,3,4
  67. ref_x1[0,1] = 0;
  68. ref_y1[0,1] = 0;
  69. ref_z1[0,1] = 0;
  70. ref_x2[0,1] = 2;
  71. ref_y2[0,1] = 2;
  72. ref_z2[0,1] = 2;
  73. ref_x3[0,1] = 3;
  74. ref_y3[0,1] = 3;
  75. ref_z3[0,1] = 3;
  76.  
  77. //polygon 1,2,6
  78. ref_x1[0,2] = 0;
  79. ref_y1[0,2] = 0;
  80. ref_z1[0,2] = 0;
  81. ref_x2[0,2] = 1;
  82. ref_y2[0,2] = 1;
  83. ref_z2[0,2] = 1;
  84. ref_x3[0,2] = 5;
  85. ref_y3[0,2] = 5;
  86. ref_z3[0,2] = 5;
  87.  
  88. //polygon 1,4,8
  89. ref_x1[0,3] = 0;
  90. ref_y1[0,3] = 0;
  91. ref_z1[0,3] = 0;
  92. ref_x2[0,3] = 3;
  93. ref_y2[0,3] = 3;
  94. ref_z2[0,3] = 3;
  95. ref_x3[0,3] = 7;
  96. ref_y3[0,3] = 7;
  97. ref_z3[0,3] = 7;
  98.  
  99. //polygon 1,5,6
  100. ref_x1[0,4] = 0;
  101. ref_y1[0,4] = 0;
  102. ref_z1[0,4] = 0;
  103. ref_x2[0,4] = 4;
  104. ref_y2[0,4] = 4;
  105. ref_z2[0,4] = 4;
  106. ref_x3[0,4] = 5;
  107. ref_y3[0,4] = 5;
  108. ref_z3[0,4] = 5;
  109.  
  110. //polygon 1,5,8
  111. ref_x1[0,5] = 0;
  112. ref_y1[0,5] = 0;
  113. ref_z1[0,5] = 0;
  114. ref_x2[0,5] = 4;
  115. ref_y2[0,5] = 4;
  116. ref_z2[0,5] = 4;
  117. ref_x3[0,5] = 7;
  118. ref_y3[0,5] = 7;
  119. ref_z3[0,5] = 7;
  120.  
  121. //polygon 2,3,6
  122. ref_x1[0,6] = 1;
  123. ref_y1[0,6] = 1;
  124. ref_z1[0,6] = 1;
  125. ref_x2[0,6] = 2;
  126. ref_y2[0,6] = 2;
  127. ref_z2[0,6] = 2;
  128. ref_x3[0,6] = 5;
  129. ref_y3[0,6] = 5;
  130. ref_z3[0,6] = 5;
  131.  
  132. //polygon 3,4,8
  133. ref_x1[0,7] = 2;
  134. ref_y1[0,7] = 2;
  135. ref_z1[0,7] = 2;
  136. ref_x2[0,7] = 3;
  137. ref_y2[0,7] = 3;
  138. ref_z2[0,7] = 3;
  139. ref_x3[0,7] = 7;
  140. ref_y3[0,7] = 7;
  141. ref_z3[0,7] = 7;
  142.  
  143. //polygon 3,6,7
  144. ref_x1[0,8] = 2;
  145. ref_y1[0,8] = 2;
  146. ref_z1[0,8] = 2;
  147. ref_x2[0,8] = 5;
  148. ref_y2[0,8] = 5;
  149. ref_z2[0,8] = 5;
  150. ref_x3[0,8] = 6;
  151. ref_y3[0,8] = 6;
  152. ref_z3[0,8] = 6;
  153.  
  154. //polygon 3,7,8
  155. ref_x1[0,9] = 2;
  156. ref_y1[0,9] = 2;
  157. ref_z1[0,9] = 2;
  158. ref_x2[0,9] = 6;
  159. ref_y2[0,9] = 6;
  160. ref_z2[0,9] = 6;
  161. ref_x3[0,9] = 7;
  162. ref_y3[0,9] = 7;
  163. ref_z3[0,9] = 7;
  164.  
  165. //polygon 5,6,8
  166. ref_x1[0,10] = 4;
  167. ref_y1[0,10] = 4;
  168. ref_z1[0,10] = 4;
  169. ref_x2[0,10] = 5;
  170. ref_y2[0,10] = 5;
  171. ref_z2[0,10] = 5;
  172. ref_x3[0,10] = 7;
  173. ref_y3[0,10] = 7;
  174. ref_z3[0,10] = 7;
  175.  
  176. //polygon 6,7,8
  177. ref_x1[0,11] = 5;
  178. ref_y1[0,11] = 5;
  179. ref_z1[0,11] = 5;
  180. ref_x2[0,11] = 6;
  181. ref_y2[0,11] = 6;
  182. ref_z2[0,11] = 6;
  183. ref_x3[0,11] = 7;
  184. ref_y3[0,11] = 7;
  185. ref_z3[0,11] = 7;
  186.  
  187. reffacecol[0,0] = c_red;
  188. reffacecol[0,1] = c_red;
  189. reffacecol[0,2] = c_yellow;
  190. reffacecol[0,3] = c_yellow;
  191. reffacecol[0,4] = c_blue;
  192. reffacecol[0,5] = c_blue;
  193. reffacecol[0,6] = c_green;
  194. reffacecol[0,7] = c_green;
  195. reffacecol[0,8] = c_purple;
  196. reffacecol[0,9] = c_purple;
  197. reffacecol[0,10] = c_orange;
  198. reffacecol[0,11] = c_orange;
  199. //end of the create event
RAW Paste Data