Advertisement
GregroxMun

procedural asteroid

Aug 2nd, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.92 KB | None | 0 0
  1. @Kopernicus:FOR[ProceduralAsteroid]
  2. {
  3. Body
  4. {
  5. //--------------------------------------------------------------------------------------------------------------//
  6. name = Procedure
  7. //Whatever name you want
  8.  
  9. AsteroidGeneratorSettings
  10. {
  11. Description = A Generic Asteroid
  12. //describe the asteroid
  13.  
  14. Radius = 21
  15. //About half of the asteroid's size in kilometers
  16.  
  17.  
  18. Density = 3.8
  19. //1.1 for icy, 2 for rocky, 3.5 for rocky/metallic, 6 for metallic. Multiply for 10 to get Kerbalized version.
  20. //density times radius is gravity (in relative units)
  21.  
  22.  
  23. Seed = 52699271
  24. //Any number you want, used to randomize some of the PQSmods
  25.  
  26. PolynomialSeed = 46.4
  27. //Any number from 1 to 65. (Does not have to be an integer)
  28. //Determines lumpiness.
  29.  
  30.  
  31. ColorOne = RGBA(164, 132, 125, 255)
  32. ColorTwo = RGBA(74, 70, 55, 255)
  33. //http://www.colorpicker.com/
  34. //Changes the colors of the PQSMods
  35. //Default is the colors of Gilly
  36. }
  37. ScaledVersion
  38. {
  39. Material
  40. {
  41. texture =
  42. normals =
  43. //Example: texture = MyMod/PluginData/Name_Color.png
  44. //Put these in after exporting them in KittopiaTech.
  45. //Export at 512 resolution for objects smaller than 10km, 1024 for objects smaller than 50km.
  46. }
  47. }
  48. Orbit
  49. {
  50. //Default parameters represent 4 Vesta, but you can change them freely however you like.
  51.  
  52. referenceBody = Sun
  53. semiMajorAxis = 2.53318755e10
  54. eccentricity = 0.08874
  55.  
  56. }
  57. //
  58. //
  59. //
  60. //--------------------------------------------------------------------------------------------------------------//
  61. //Don't touch anything below here unless you know what you're doing.
  62. //--------------------------------------------------------------------------------------------------------------//
  63. //
  64. //
  65. //
  66. //
  67. //
  68. //
  69. PolynomialFunction1
  70. {
  71. //y=1.8+(0.06(x^6 - 21.29x^5 + 180.145x^4 - 770.323x^3 + 1739.539x^2 - 1937.123x + 808.053))
  72. //Useful Domain: 1 < x < 6
  73.  
  74. x = #$../AsteroidGeneratorSettings/Seed2$
  75. @X /= 10
  76. //input
  77.  
  78. Xt1 = #$X$
  79. @Xt1 != 6
  80.  
  81. Xt2 = #$X$
  82. @Xt2 != 5
  83. @Xt2 *= 21.29
  84.  
  85. Xt3 = #$X$
  86. @Xt3 != 4
  87. @Xt3 *= 180.145
  88.  
  89. Xt4 = #$X$
  90. @Xt4 != 3
  91. @Xt4 *= 770.323
  92.  
  93. Xt5 = #$X$
  94. @Xt5 != 2
  95. @Xt5 *= 1739.539
  96.  
  97. Xt6 = #$X$
  98. @Xt6 != 1
  99. @Xt6 *= 1937.123
  100.  
  101. Xt7 = #$X$
  102. @Xt7 != 0
  103. @Xt7 *= 808.053
  104.  
  105. Yans = #$Xt1$
  106. @Yans -= #$Xt2$
  107. @Yans += #$Xt3$
  108. @Yans -= #$Xt4$
  109. @Yans += #$Xt5$
  110. @Yans -= #$Xt6$
  111. @Yans += #$Xt7$
  112. @Yans *= 0.06
  113. @Yans += 1.8
  114.  
  115. }
  116. Template
  117. {
  118. name = Gilly
  119. }
  120. Properties
  121. {
  122. description = #$../AsteroidGeneratorSettings/Description$
  123.  
  124. radius = 1
  125.  
  126. @radius *= #$../AsteroidGeneratorSettings/Radius$
  127.  
  128. @radius *= 1000
  129.  
  130. geeASL = 1
  131.  
  132. @geeASL *= #$../AsteroidGeneratorSettings/Radius$
  133.  
  134. @geeASL /= 6371
  135.  
  136. @geeASL *= #$../AsteroidGeneratorSettings/Density$
  137.  
  138. @geeASL /= 5.51
  139.  
  140. }
  141. PQS
  142. {
  143. Mods
  144. {
  145. VertexSimplexHeightAbsolute
  146. {
  147. frequency = 0.5
  148. @frequency *= #$../../../AsteroidGeneratorSettings/LumpinessMultiplier$
  149. deformity = 8000
  150. @deformity *= #$../../../AsteroidGeneratorSettings/Radius$
  151. @deformity /= 15
  152. @deformity *= #$../../../AsteroidGeneratorSettings/LumpHeightMultiplier$
  153. seed = #$../../../AsteroidGeneratorSettings/Seed$
  154. }
  155. VertexHeightNoise
  156. {
  157. deformity = 150
  158. seed = #$../../../AsteroidGeneratorSettings/Seed$
  159. }
  160. VertexSimplexNoiseColor
  161. {
  162. colorStart = #$../../../AsteroidGeneratorSettings/ColorOne$
  163. colorEnd = #$../../../AsteroidGeneratorSettings/ColorTwo$
  164. seed = #$../../../AsteroidGeneratorSettings/Seed$
  165. }
  166. VoronoiCraters
  167. {
  168. name = Craters1
  169. colorOpacity = 0.2
  170. DebugColorMapping = False
  171. deformation = 286
  172. @deformation *= #$../../../AsteroidGeneratorSettings/Radius$
  173. @deformation /= 15
  174. jitter = 0.1
  175. jitterHeight = 3
  176. rFactor = 1
  177. rOffset = 1
  178. simplexFrequency = 120
  179. simplexOctaves = 3
  180. simplexPersistence = 0.5
  181. simplexSeed = #$../../../AsteroidGeneratorSettings/Seed$
  182. voronoiDisplacement = 0
  183. voronoiFrequency = 5
  184. voronoiSeed = #$../../../AsteroidGeneratorSettings/Seed$
  185. order = 101
  186. enabled = True
  187. index = 0
  188. CraterCurve
  189. {
  190. key = -0.9982381 -0.7411783 -0.06500059 -0.06500059
  191. key = -0.9332262 -0.7678316 -0.2176399 -0.2176399
  192. key = -0.8990405 -0.7433339 -2.560626 -2.560626
  193. key = -0.7445966 -0.8581167 0.4436148 0.4436148
  194. key = -0.4499771 -0.1392395 5.289535 5.289535
  195. key = -0.4015177 0.2551735 9.069458 -2.149609
  196. key = -0.2297457 0.002857953 -0.4453675 -0.4453675
  197. key = 0.2724952 0.00423781 -0.01884932 -0.01884932
  198. key = 0.9998434 -0.004090764 0.01397126 0.01397126
  199. }
  200. JitterCurve
  201. {
  202. key = -1.000701 0.4278412 0.1577609 0.1577609
  203. key = -0.7884969 0.09487452 -0.7739663 -0.7739663
  204. key = -0.6091803 0.072019 0.123537 0.123537
  205. key = -0.3930514 0.3903495 3.300831 3.300831
  206. key = -0.3584836 0.8643304 0.07139917 0.07139917
  207. key = -0.2988068 0.002564805 -0.01814346 -0.01814346
  208. key = 0.9970253 0.003401639 0 0
  209. }
  210. }
  211. VoronoiCraters
  212. {
  213. name = Craters2
  214. colorOpacity = 0.2
  215. DebugColorMapping = False
  216. deformation = 340
  217. @deformation *= #$../../../AsteroidGeneratorSettings/Radius$
  218. @deformation /= 15
  219. jitter = 0.1
  220. jitterHeight = 3
  221. rFactor = 1
  222. rOffset = 1
  223. simplexFrequency = 120
  224. simplexOctaves = 3
  225. simplexPersistence = 0.5
  226. simplexSeed = #$../../../AsteroidGeneratorSettings/Seed$
  227. voronoiDisplacement = 0
  228. voronoiFrequency = 2
  229. voronoiSeed = #$../../../AsteroidGeneratorSettings/Seed$
  230. @voronoiSeed *= 2
  231. order = 101
  232. enabled = True
  233. index = 0
  234. CraterCurve
  235. {
  236. key = -0.9982381 -0.7411783 -0.06500059 -0.06500059
  237. key = -0.9332262 -0.7678316 -0.2176399 -0.2176399
  238. key = -0.8990405 -0.7433339 -2.560626 -2.560626
  239. key = -0.7445966 -0.8581167 0.4436148 0.4436148
  240. key = -0.4499771 -0.1392395 5.289535 5.289535
  241. key = -0.4015177 0.2551735 9.069458 -2.149609
  242. key = -0.2297457 0.002857953 -0.4453675 -0.4453675
  243. key = 0.2724952 0.00423781 -0.01884932 -0.01884932
  244. key = 0.9998434 -0.004090764 0.01397126 0.01397126
  245. }
  246. JitterCurve
  247. {
  248. key = -1.000701 0.4278412 0.1577609 0.1577609
  249. key = -0.7884969 0.09487452 -0.7739663 -0.7739663
  250. key = -0.6091803 0.072019 0.123537 0.123537
  251. key = -0.3930514 0.3903495 3.300831 3.300831
  252. key = -0.3584836 0.8643304 0.07139917 0.07139917
  253. key = -0.2988068 0.002564805 -0.01814346 -0.01814346
  254. key = 0.9970253 0.003401639 0 0
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement