joonsrenderer 1.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +53 -0
  3. data/.mvn/extensions.xml +8 -0
  4. data/CHANGELOG.md +2 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE +674 -0
  7. data/README.md +2 -0
  8. data/Rakefile +43 -0
  9. data/docs/.gitignore +6 -0
  10. data/docs/_config.yml +20 -0
  11. data/docs/_includes/footer.html +38 -0
  12. data/docs/_includes/head.html +15 -0
  13. data/docs/_includes/header.html +27 -0
  14. data/docs/_includes/icon-github.html +1 -0
  15. data/docs/_includes/icon-github.svg +1 -0
  16. data/docs/_includes/icon-twitter.html +1 -0
  17. data/docs/_includes/icon-twitter.svg +1 -0
  18. data/docs/_layouts/default.html +20 -0
  19. data/docs/_layouts/page.html +14 -0
  20. data/docs/_layouts/post.html +15 -0
  21. data/docs/_posts/2017-01-08-animated_ray_tracing.md +72 -0
  22. data/docs/_posts/2017-01-08-welcome.md +78 -0
  23. data/docs/_sass/_base.scss +206 -0
  24. data/docs/_sass/_layout.scss +242 -0
  25. data/docs/_sass/_syntax-highlighting.scss +71 -0
  26. data/docs/about.md +12 -0
  27. data/docs/assets/Animation.ogv +0 -0
  28. data/docs/assets/Animation.png +0 -0
  29. data/docs/assets/basic.png +0 -0
  30. data/docs/assets/basic_traced.png +0 -0
  31. data/docs/css/main.scss +38 -0
  32. data/docs/favicon.ico +0 -0
  33. data/docs/feed.xml +30 -0
  34. data/docs/index.html +38 -0
  35. data/joonsrenderer.gemspec +23 -0
  36. data/lib/joonsrenderer.rb +12 -0
  37. data/lib/joonsrenderer/version.rb +3 -0
  38. data/pom.rb +75 -0
  39. data/pom.xml +163 -0
  40. data/src/main/java/SunflowGUI.java +1354 -0
  41. data/src/main/java/joons/JRFiller.java +79 -0
  42. data/src/main/java/joons/JRImagePanel.java +141 -0
  43. data/src/main/java/joons/JRRecorder.java +183 -0
  44. data/src/main/java/joons/JRStatics.java +199 -0
  45. data/src/main/java/joons/JoonsRenderer.java +837 -0
  46. data/src/main/java/org/sunflow/AsciiFileSunflowAPI.java +98 -0
  47. data/src/main/java/org/sunflow/Benchmark.java +313 -0
  48. data/src/main/java/org/sunflow/BinaryFileSunflowAPI.java +228 -0
  49. data/src/main/java/org/sunflow/FileSunflowAPI.java +354 -0
  50. data/src/main/java/org/sunflow/PluginRegistry.java +322 -0
  51. data/src/main/java/org/sunflow/RealtimeBenchmark.java +125 -0
  52. data/src/main/java/org/sunflow/RenderObjectMap.java +344 -0
  53. data/src/main/java/org/sunflow/SunflowAPI.java +762 -0
  54. data/src/main/java/org/sunflow/SunflowAPIInterface.java +277 -0
  55. data/src/main/java/org/sunflow/core/AccelerationStructure.java +20 -0
  56. data/src/main/java/org/sunflow/core/AccelerationStructureFactory.java +36 -0
  57. data/src/main/java/org/sunflow/core/BucketOrder.java +21 -0
  58. data/src/main/java/org/sunflow/core/Camera.java +125 -0
  59. data/src/main/java/org/sunflow/core/CameraLens.java +29 -0
  60. data/src/main/java/org/sunflow/core/CausticPhotonMapInterface.java +15 -0
  61. data/src/main/java/org/sunflow/core/Display.java +78 -0
  62. data/src/main/java/org/sunflow/core/Filter.java +27 -0
  63. data/src/main/java/org/sunflow/core/GIEngine.java +42 -0
  64. data/src/main/java/org/sunflow/core/Geometry.java +157 -0
  65. data/src/main/java/org/sunflow/core/GlobalPhotonMapInterface.java +21 -0
  66. data/src/main/java/org/sunflow/core/ImageSampler.java +26 -0
  67. data/src/main/java/org/sunflow/core/Instance.java +224 -0
  68. data/src/main/java/org/sunflow/core/InstanceList.java +83 -0
  69. data/src/main/java/org/sunflow/core/IntersectionState.java +120 -0
  70. data/src/main/java/org/sunflow/core/LightSample.java +104 -0
  71. data/src/main/java/org/sunflow/core/LightServer.java +382 -0
  72. data/src/main/java/org/sunflow/core/LightSource.java +67 -0
  73. data/src/main/java/org/sunflow/core/Modifier.java +16 -0
  74. data/src/main/java/org/sunflow/core/Options.java +20 -0
  75. data/src/main/java/org/sunflow/core/ParameterList.java +758 -0
  76. data/src/main/java/org/sunflow/core/PhotonStore.java +62 -0
  77. data/src/main/java/org/sunflow/core/PrimitiveList.java +70 -0
  78. data/src/main/java/org/sunflow/core/Ray.java +219 -0
  79. data/src/main/java/org/sunflow/core/RenderObject.java +25 -0
  80. data/src/main/java/org/sunflow/core/Scene.java +377 -0
  81. data/src/main/java/org/sunflow/core/SceneParser.java +58 -0
  82. data/src/main/java/org/sunflow/core/Shader.java +30 -0
  83. data/src/main/java/org/sunflow/core/ShadingCache.java +84 -0
  84. data/src/main/java/org/sunflow/core/ShadingState.java +939 -0
  85. data/src/main/java/org/sunflow/core/Statistics.java +85 -0
  86. data/src/main/java/org/sunflow/core/Tesselatable.java +36 -0
  87. data/src/main/java/org/sunflow/core/Texture.java +128 -0
  88. data/src/main/java/org/sunflow/core/TextureCache.java +48 -0
  89. data/src/main/java/org/sunflow/core/accel/BoundingIntervalHierarchy.java +652 -0
  90. data/src/main/java/org/sunflow/core/accel/KDTree.java +833 -0
  91. data/src/main/java/org/sunflow/core/accel/NullAccelerator.java +30 -0
  92. data/src/main/java/org/sunflow/core/accel/UniformGrid.java +329 -0
  93. data/src/main/java/org/sunflow/core/bucket/BucketOrderFactory.java +26 -0
  94. data/src/main/java/org/sunflow/core/bucket/ColumnBucketOrder.java +21 -0
  95. data/src/main/java/org/sunflow/core/bucket/DiagonalBucketOrder.java +28 -0
  96. data/src/main/java/org/sunflow/core/bucket/HilbertBucketOrder.java +65 -0
  97. data/src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java +28 -0
  98. data/src/main/java/org/sunflow/core/bucket/RandomBucketOrder.java +49 -0
  99. data/src/main/java/org/sunflow/core/bucket/RowBucketOrder.java +21 -0
  100. data/src/main/java/org/sunflow/core/bucket/SpiralBucketOrder.java +43 -0
  101. data/src/main/java/org/sunflow/core/camera/FisheyeLens.java +25 -0
  102. data/src/main/java/org/sunflow/core/camera/PinholeLens.java +43 -0
  103. data/src/main/java/org/sunflow/core/camera/SphericalLens.java +22 -0
  104. data/src/main/java/org/sunflow/core/camera/ThinLens.java +107 -0
  105. data/src/main/java/org/sunflow/core/display/FastDisplay.java +119 -0
  106. data/src/main/java/org/sunflow/core/display/FileDisplay.java +83 -0
  107. data/src/main/java/org/sunflow/core/display/FrameDisplay.java +97 -0
  108. data/src/main/java/org/sunflow/core/display/ImgPipeDisplay.java +109 -0
  109. data/src/main/java/org/sunflow/core/filter/BlackmanHarrisFilter.java +28 -0
  110. data/src/main/java/org/sunflow/core/filter/BoxFilter.java +16 -0
  111. data/src/main/java/org/sunflow/core/filter/CatmullRomFilter.java +29 -0
  112. data/src/main/java/org/sunflow/core/filter/CubicBSpline.java +32 -0
  113. data/src/main/java/org/sunflow/core/filter/GaussianFilter.java +24 -0
  114. data/src/main/java/org/sunflow/core/filter/LanczosFilter.java +30 -0
  115. data/src/main/java/org/sunflow/core/filter/MitchellFilter.java +28 -0
  116. data/src/main/java/org/sunflow/core/filter/SincFilter.java +25 -0
  117. data/src/main/java/org/sunflow/core/filter/TriangleFilter.java +16 -0
  118. data/src/main/java/org/sunflow/core/gi/AmbientOcclusionGIEngine.java +57 -0
  119. data/src/main/java/org/sunflow/core/gi/FakeGIEngine.java +48 -0
  120. data/src/main/java/org/sunflow/core/gi/InstantGI.java +194 -0
  121. data/src/main/java/org/sunflow/core/gi/IrradianceCacheGIEngine.java +268 -0
  122. data/src/main/java/org/sunflow/core/gi/PathTracingGIEngine.java +65 -0
  123. data/src/main/java/org/sunflow/core/light/DirectionalSpotlight.java +103 -0
  124. data/src/main/java/org/sunflow/core/light/ImageBasedLight.java +303 -0
  125. data/src/main/java/org/sunflow/core/light/PointLight.java +72 -0
  126. data/src/main/java/org/sunflow/core/light/SphereLight.java +166 -0
  127. data/src/main/java/org/sunflow/core/light/SunSkyLight.java +362 -0
  128. data/src/main/java/org/sunflow/core/light/TriangleMeshLight.java +296 -0
  129. data/src/main/java/org/sunflow/core/modifiers/BumpMappingModifier.java +37 -0
  130. data/src/main/java/org/sunflow/core/modifiers/NormalMapModifier.java +34 -0
  131. data/src/main/java/org/sunflow/core/modifiers/PerlinModifier.java +80 -0
  132. data/src/main/java/org/sunflow/core/parser/Keyword.java +39 -0
  133. data/src/main/java/org/sunflow/core/parser/RA2Parser.java +107 -0
  134. data/src/main/java/org/sunflow/core/parser/RA3Parser.java +68 -0
  135. data/src/main/java/org/sunflow/core/parser/SCAbstractParser.java +299 -0
  136. data/src/main/java/org/sunflow/core/parser/SCAsciiParser.java +251 -0
  137. data/src/main/java/org/sunflow/core/parser/SCBinaryParser.java +156 -0
  138. data/src/main/java/org/sunflow/core/parser/SCParser.java +1403 -0
  139. data/src/main/java/org/sunflow/core/parser/ShaveRibParser.java +174 -0
  140. data/src/main/java/org/sunflow/core/parser/TriParser.java +79 -0
  141. data/src/main/java/org/sunflow/core/photonmap/CausticPhotonMap.java +429 -0
  142. data/src/main/java/org/sunflow/core/photonmap/GlobalPhotonMap.java +530 -0
  143. data/src/main/java/org/sunflow/core/photonmap/GridPhotonMap.java +308 -0
  144. data/src/main/java/org/sunflow/core/primitive/Background.java +55 -0
  145. data/src/main/java/org/sunflow/core/primitive/BanchoffSurface.java +100 -0
  146. data/src/main/java/org/sunflow/core/primitive/Box.java +210 -0
  147. data/src/main/java/org/sunflow/core/primitive/CornellBox.java +476 -0
  148. data/src/main/java/org/sunflow/core/primitive/CubeGrid.java +318 -0
  149. data/src/main/java/org/sunflow/core/primitive/Cylinder.java +104 -0
  150. data/src/main/java/org/sunflow/core/primitive/Hair.java +275 -0
  151. data/src/main/java/org/sunflow/core/primitive/JuliaFractal.java +266 -0
  152. data/src/main/java/org/sunflow/core/primitive/ParticleSurface.java +114 -0
  153. data/src/main/java/org/sunflow/core/primitive/Plane.java +163 -0
  154. data/src/main/java/org/sunflow/core/primitive/QuadMesh.java +413 -0
  155. data/src/main/java/org/sunflow/core/primitive/Sphere.java +101 -0
  156. data/src/main/java/org/sunflow/core/primitive/SphereFlake.java +234 -0
  157. data/src/main/java/org/sunflow/core/primitive/Torus.java +145 -0
  158. data/src/main/java/org/sunflow/core/primitive/TriangleMesh.java +849 -0
  159. data/src/main/java/org/sunflow/core/renderer/BucketRenderer.java +491 -0
  160. data/src/main/java/org/sunflow/core/renderer/MultipassRenderer.java +237 -0
  161. data/src/main/java/org/sunflow/core/renderer/ProgressiveRenderer.java +171 -0
  162. data/src/main/java/org/sunflow/core/renderer/SimpleRenderer.java +106 -0
  163. data/src/main/java/org/sunflow/core/shader/AmbientOcclusionShader.java +53 -0
  164. data/src/main/java/org/sunflow/core/shader/AnisotropicWardShader.java +216 -0
  165. data/src/main/java/org/sunflow/core/shader/ConstantShader.java +31 -0
  166. data/src/main/java/org/sunflow/core/shader/DiffuseShader.java +65 -0
  167. data/src/main/java/org/sunflow/core/shader/GlassShader.java +147 -0
  168. data/src/main/java/org/sunflow/core/shader/IDShader.java +27 -0
  169. data/src/main/java/org/sunflow/core/shader/MirrorShader.java +68 -0
  170. data/src/main/java/org/sunflow/core/shader/NormalShader.java +32 -0
  171. data/src/main/java/org/sunflow/core/shader/PhongShader.java +89 -0
  172. data/src/main/java/org/sunflow/core/shader/PrimIDShader.java +30 -0
  173. data/src/main/java/org/sunflow/core/shader/QuickGrayShader.java +63 -0
  174. data/src/main/java/org/sunflow/core/shader/ShinyDiffuseShader.java +98 -0
  175. data/src/main/java/org/sunflow/core/shader/SimpleShader.java +24 -0
  176. data/src/main/java/org/sunflow/core/shader/TexturedAmbientOcclusionShader.java +31 -0
  177. data/src/main/java/org/sunflow/core/shader/TexturedDiffuseShader.java +31 -0
  178. data/src/main/java/org/sunflow/core/shader/TexturedPhongShader.java +31 -0
  179. data/src/main/java/org/sunflow/core/shader/TexturedShinyDiffuseShader.java +31 -0
  180. data/src/main/java/org/sunflow/core/shader/TexturedWardShader.java +31 -0
  181. data/src/main/java/org/sunflow/core/shader/UVShader.java +27 -0
  182. data/src/main/java/org/sunflow/core/shader/UberShader.java +149 -0
  183. data/src/main/java/org/sunflow/core/shader/ViewCausticsShader.java +33 -0
  184. data/src/main/java/org/sunflow/core/shader/ViewGlobalPhotonsShader.java +25 -0
  185. data/src/main/java/org/sunflow/core/shader/ViewIrradianceShader.java +25 -0
  186. data/src/main/java/org/sunflow/core/shader/WireframeShader.java +83 -0
  187. data/src/main/java/org/sunflow/core/tesselatable/BezierMesh.java +254 -0
  188. data/src/main/java/org/sunflow/core/tesselatable/FileMesh.java +251 -0
  189. data/src/main/java/org/sunflow/core/tesselatable/Gumbo.java +1147 -0
  190. data/src/main/java/org/sunflow/core/tesselatable/Teapot.java +237 -0
  191. data/src/main/java/org/sunflow/image/Bitmap.java +15 -0
  192. data/src/main/java/org/sunflow/image/BitmapReader.java +39 -0
  193. data/src/main/java/org/sunflow/image/BitmapWriter.java +79 -0
  194. data/src/main/java/org/sunflow/image/BlackbodySpectrum.java +16 -0
  195. data/src/main/java/org/sunflow/image/ChromaticitySpectrum.java +55 -0
  196. data/src/main/java/org/sunflow/image/Color.java +374 -0
  197. data/src/main/java/org/sunflow/image/ColorEncoder.java +94 -0
  198. data/src/main/java/org/sunflow/image/ColorFactory.java +122 -0
  199. data/src/main/java/org/sunflow/image/ConstantSpectralCurve.java +21 -0
  200. data/src/main/java/org/sunflow/image/IrregularSpectralCurve.java +57 -0
  201. data/src/main/java/org/sunflow/image/RGBSpace.java +207 -0
  202. data/src/main/java/org/sunflow/image/RegularSpectralCurve.java +30 -0
  203. data/src/main/java/org/sunflow/image/SpectralCurve.java +118 -0
  204. data/src/main/java/org/sunflow/image/XYZColor.java +50 -0
  205. data/src/main/java/org/sunflow/image/formats/BitmapBlack.java +27 -0
  206. data/src/main/java/org/sunflow/image/formats/BitmapG8.java +36 -0
  207. data/src/main/java/org/sunflow/image/formats/BitmapGA8.java +30 -0
  208. data/src/main/java/org/sunflow/image/formats/BitmapRGB8.java +40 -0
  209. data/src/main/java/org/sunflow/image/formats/BitmapRGBA8.java +40 -0
  210. data/src/main/java/org/sunflow/image/formats/BitmapRGBE.java +60 -0
  211. data/src/main/java/org/sunflow/image/formats/BitmapXYZ.java +38 -0
  212. data/src/main/java/org/sunflow/image/formats/GenericBitmap.java +73 -0
  213. data/src/main/java/org/sunflow/image/readers/BMPBitmapReader.java +39 -0
  214. data/src/main/java/org/sunflow/image/readers/HDRBitmapReader.java +155 -0
  215. data/src/main/java/org/sunflow/image/readers/IGIBitmapReader.java +104 -0
  216. data/src/main/java/org/sunflow/image/readers/JPGBitmapReader.java +39 -0
  217. data/src/main/java/org/sunflow/image/readers/PNGBitmapReader.java +40 -0
  218. data/src/main/java/org/sunflow/image/readers/TGABitmapReader.java +141 -0
  219. data/src/main/java/org/sunflow/image/writers/EXRBitmapWriter.java +395 -0
  220. data/src/main/java/org/sunflow/image/writers/HDRBitmapWriter.java +54 -0
  221. data/src/main/java/org/sunflow/image/writers/IGIBitmapWriter.java +75 -0
  222. data/src/main/java/org/sunflow/image/writers/PNGBitmapWriter.java +39 -0
  223. data/src/main/java/org/sunflow/image/writers/TGABitmapWriter.java +63 -0
  224. data/src/main/java/org/sunflow/math/BoundingBox.java +340 -0
  225. data/src/main/java/org/sunflow/math/MathUtils.java +159 -0
  226. data/src/main/java/org/sunflow/math/Matrix4.java +573 -0
  227. data/src/main/java/org/sunflow/math/MovingMatrix4.java +119 -0
  228. data/src/main/java/org/sunflow/math/OrthoNormalBasis.java +110 -0
  229. data/src/main/java/org/sunflow/math/PerlinScalar.java +331 -0
  230. data/src/main/java/org/sunflow/math/PerlinVector.java +132 -0
  231. data/src/main/java/org/sunflow/math/Point2.java +36 -0
  232. data/src/main/java/org/sunflow/math/Point3.java +133 -0
  233. data/src/main/java/org/sunflow/math/QMC.java +209 -0
  234. data/src/main/java/org/sunflow/math/Solvers.java +142 -0
  235. data/src/main/java/org/sunflow/math/Vector3.java +197 -0
  236. data/src/main/java/org/sunflow/system/BenchmarkFramework.java +73 -0
  237. data/src/main/java/org/sunflow/system/BenchmarkTest.java +17 -0
  238. data/src/main/java/org/sunflow/system/ByteUtil.java +119 -0
  239. data/src/main/java/org/sunflow/system/FileUtils.java +27 -0
  240. data/src/main/java/org/sunflow/system/ImagePanel.java +282 -0
  241. data/src/main/java/org/sunflow/system/Memory.java +18 -0
  242. data/src/main/java/org/sunflow/system/Parser.java +162 -0
  243. data/src/main/java/org/sunflow/system/Plugins.java +142 -0
  244. data/src/main/java/org/sunflow/system/RenderGlobalsPanel.java +209 -0
  245. data/src/main/java/org/sunflow/system/SearchPath.java +67 -0
  246. data/src/main/java/org/sunflow/system/Timer.java +53 -0
  247. data/src/main/java/org/sunflow/system/UI.java +112 -0
  248. data/src/main/java/org/sunflow/system/UserInterface.java +46 -0
  249. data/src/main/java/org/sunflow/system/ui/ConsoleInterface.java +48 -0
  250. data/src/main/java/org/sunflow/system/ui/SilentInterface.java +28 -0
  251. data/src/main/java/org/sunflow/util/FastHashMap.java +220 -0
  252. data/src/main/java/org/sunflow/util/FloatArray.java +77 -0
  253. data/src/main/java/org/sunflow/util/IntArray.java +77 -0
  254. data/src/test/java/a_maintest.java +129 -0
  255. metadata +300 -0
@@ -0,0 +1,2 @@
1
+ # joonsrenderer
2
+ gem to use sunflow (raytacer) with JRubyArt and propane
@@ -0,0 +1,43 @@
1
+ require_relative 'lib/joonsrenderer/version'
2
+
3
+ def create_manifest
4
+ title = 'Implementation-Title: joonsrenderer (java extension for joonsrenderer gem)'
5
+ version = format('Implementation-Version: %s', JoonsRenderer::VERSION)
6
+ file = File.open('MANIFEST.MF', 'w') do |f|
7
+ f.puts(title)
8
+ f.puts(version)
9
+ f.puts('Class-Path: janino-3.0.6.jar commons-compiler-3.0.6.jar')
10
+ end
11
+ end
12
+
13
+ task default: [:init, :compile, :install, :gem]
14
+
15
+ desc 'Create Manifest'
16
+ task :init do
17
+ create_manifest
18
+ end
19
+
20
+ desc 'Build gem'
21
+ task :gem => [:install, :compile] do
22
+ sh "gem build joonsrenderer.gemspec"
23
+ end
24
+
25
+ desc 'Compile'
26
+ task :compile => [:init] do
27
+ sh "mvn package"
28
+ end
29
+
30
+ desc 'Install'
31
+ task :install do
32
+ sh "mvn dependency:copy"
33
+ sh "mv target/joonsrenderer.jar lib"
34
+ end
35
+
36
+ desc 'clean'
37
+ task :clean do
38
+ Dir['./**/*.%w{jar gem}'].each do |path|
39
+ puts "Deleting #{path} ..."
40
+ File.delete(path)
41
+ end
42
+ FileUtils.rm_rf('./target')
43
+ end
@@ -0,0 +1,6 @@
1
+
2
+ *~
3
+ _site
4
+ .sass-cache
5
+ .jekyll-metadata
6
+ Gemfile.lock
@@ -0,0 +1,20 @@
1
+ # Site settings
2
+ port: 4000
3
+ title: joonsrenderer gem for JRubyArt and propane
4
+ email: mamba2928@yahoo.co.uk
5
+ description: > # this means to ignore newlines until "baseurl:"
6
+ The joonsrenderer gem is wrapper around the joonsrenderer library by Joon HyubLee that makes it very easy to sunflow raytracing of JRubyArt and propane sketches.
7
+ baseurl: "" # the subpath of your site, e.g. /blog
8
+ regenerate: true
9
+ url: "https://ruby-processing.github.io/joonsrenderer"
10
+
11
+ urls:
12
+ bugs: https://github.com/ruby-processing/joonsrenderer/issues/
13
+ github: https://github.com/ruby-processing/joonsrenderer/
14
+ twitter_username: monkstoneT
15
+ github_username: monkstone
16
+
17
+ syntax-highlighting:
18
+ enabled: true
19
+ # Build settings
20
+ markdown: kramdown
@@ -0,0 +1,38 @@
1
+ <footer class="site-footer">
2
+
3
+ <div class="wrapper">
4
+
5
+ <h2 class="footer-heading">{{ site.title }}</h2>
6
+
7
+ <div class="footer-col-wrapper">
8
+ <div class="footer-col footer-col-1">
9
+ <ul class="contact-list">
10
+ <li>{{ site.title }}</li>
11
+ <li><a href="mailto:{{ site.email }}">{{ site.email }}</a></li>
12
+ </ul>
13
+ </div>
14
+
15
+ <div class="footer-col footer-col-2">
16
+ <ul class="social-media-list">
17
+ {% if site.github_username %}
18
+ <li>
19
+ {% include icon-github.html username=site.github_username %}
20
+ </li>
21
+ {% endif %}
22
+
23
+ {% if site.twitter_username %}
24
+ <li>
25
+ {% include icon-twitter.html username=site.twitter_username %}
26
+ </li>
27
+ {% endif %}
28
+ </ul>
29
+ </div>
30
+
31
+ <div class="footer-col footer-col-3">
32
+ <p>{{ site.description }}</p>
33
+ </div>
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </footer>
@@ -0,0 +1,15 @@
1
+ <head>
2
+ <meta charset="utf-8">
3
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ {% if page.keywords %}
6
+ <meta name="keywords" content="{{ page.keywords }}" />
7
+ {% else %}
8
+ <meta name="keywords" content="art, JRubyArt, code, blog, ruby" />
9
+ {% endif %}<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
10
+ <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
11
+
12
+ <link rel="stylesheet" href="https://ruby-processing.github.io/JRubyArt/css/main.css"/>
13
+ <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.github.url | prepend: site.url }}">
14
+ <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.github.url | prepend: site.url }}" />
15
+ </head>
@@ -0,0 +1,27 @@
1
+ <header class="site-header">
2
+
3
+ <div class="wrapper">
4
+
5
+ <a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a>
6
+
7
+ <nav class="site-nav">
8
+ <a href="#" class="menu-icon">
9
+ <svg viewBox="0 0 18 15">
10
+ <path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
11
+ <path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
12
+ <path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
13
+ </svg>
14
+ </a>
15
+
16
+ <div class="trigger">
17
+ {% for my_page in site.pages %}
18
+ {% if my_page.title %}
19
+ <a class="page-link" href="{{ my_page.url | prepend: site.github.url }}">{{ my_page.title }}</a>
20
+ {% endif %}
21
+ {% endfor %}
22
+ </div>
23
+ </nav>
24
+
25
+ </div>
26
+
27
+ </header>
@@ -0,0 +1 @@
1
+ <a href="https://github.com/{{ include.username }}"><span class="icon icon--github">{% include icon-github.svg %}</span><span class="username">{{ include.username }}</span></a>
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 16 16"><path fill="#828282" d="M7.999,0.431c-4.285,0-7.76,3.474-7.76,7.761 c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32 c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472 c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037 C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65 c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261 c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082 c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129 c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"/></svg>
@@ -0,0 +1 @@
1
+ <a href="https://twitter.com/{{ include.username }}"><span class="icon icon--twitter">{% include icon-twitter.svg %}</span><span class="username">{{ include.username }}</span></a>
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 16 16"><path fill="#828282" d="M15.969,3.058c-0.586,0.26-1.217,0.436-1.878,0.515c0.675-0.405,1.194-1.045,1.438-1.809c-0.632,0.375-1.332,0.647-2.076,0.793c-0.596-0.636-1.446-1.033-2.387-1.033c-1.806,0-3.27,1.464-3.27,3.27 c0,0.256,0.029,0.506,0.085,0.745C5.163,5.404,2.753,4.102,1.14,2.124C0.859,2.607,0.698,3.168,0.698,3.767 c0,1.134,0.577,2.135,1.455,2.722C1.616,6.472,1.112,6.325,0.671,6.08c0,0.014,0,0.027,0,0.041c0,1.584,1.127,2.906,2.623,3.206 C3.02,9.402,2.731,9.442,2.433,9.442c-0.211,0-0.416-0.021-0.615-0.059c0.416,1.299,1.624,2.245,3.055,2.271 c-1.119,0.877-2.529,1.4-4.061,1.4c-0.264,0-0.524-0.015-0.78-0.046c1.447,0.928,3.166,1.469,5.013,1.469 c6.015,0,9.304-4.983,9.304-9.304c0-0.142-0.003-0.283-0.009-0.423C14.976,4.29,15.531,3.714,15.969,3.058z"/></svg>
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ {% include head.html %}
5
+
6
+ <body>
7
+
8
+ {% include header.html %}
9
+
10
+ <div class="page-content">
11
+ <div class="wrapper">
12
+ {{ content }}
13
+ </div>
14
+ </div>
15
+
16
+ {% include footer.html %}
17
+
18
+ </body>
19
+
20
+ </html>
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <article class="post">
5
+
6
+ <header class="post-header">
7
+ <h1 class="post-title">{{ page.title }}</h1>
8
+ </header>
9
+
10
+ <div class="post-content">
11
+ {{ content }}
12
+ </div>
13
+
14
+ </article>
@@ -0,0 +1,15 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
5
+
6
+ <header class="post-header">
7
+ <h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
8
+ <p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time>{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}</p>
9
+ </header>
10
+
11
+ <div class="post-content" itemprop="articleBody">
12
+ {{ content }}
13
+ </div>
14
+
15
+ </article>
@@ -0,0 +1,72 @@
1
+ ---
2
+ layout: post
3
+ title: "Animation using raytraced images"
4
+ date: 2017-01-08 05:31:13
5
+ categories: joonsrenderer update
6
+ ---
7
+ Sunflow is an open source global illumination rendering system written in Java written by [Christopher Kulla][fpsunflower]. I have recently updated to [build with maven][maven] using jdk-8 and to use the latest [janino jars][janino]. This is gem makes sunflow rendering easily available to `JRubyArt` and `propane` users using Joon Hylub Lees [joons-renderer][joons]:-
8
+
9
+ ### test.rb (JRubyArt Sketch)
10
+ ```ruby
11
+ load_library :joonsrenderer
12
+ include_package 'joons'
13
+
14
+ attr_reader :jr, :eye, :center, :up, :count, :radius, :file_name
15
+
16
+ def settings
17
+ size(800, 600, P3D)
18
+ end
19
+
20
+ def setup
21
+ sketch_title 'Animation'
22
+ @file_name = 'Animation'
23
+ @jr = JoonsRenderer.new(self)
24
+ # Camera Setting.
25
+ @eye = Vec3D.new(0, 0, 120)
26
+ @center = Vec3D.new(0, 0, -1)
27
+ @up = Vec3D.new(0, 1, 0)
28
+ @count = 0
29
+ @radius = 35
30
+ end
31
+
32
+ def draw
33
+ jr.render # The draw loop that comes next is rendered
34
+ jr.begin_record # Make sure to include things you want rendered.
35
+ kamera(eye: eye, center: center, up: up)
36
+ perspektiv(fov: PI / 4.0, aspect_ratio: 4 / 3.0, near_z: 5, far_z: 10_000)
37
+ jr.background('cornell_box', 100, 100, 100) # Cornell Box: width, height, depth.
38
+ jr.background('gi_ambient_occlusion') # Global illumination.
39
+ # Sun.
40
+ translate(0, -15, 0)
41
+ jr.fill('light', 1, 60, 60)
42
+ sphere(5)
43
+ # Planet, revolving at +3 degrees per frame.
44
+ translate(radius * DegLut.cos(count * 3), 0, radius * DegLut.sin(count * 3))
45
+ jr.fill('mirror')
46
+ sphere(5)
47
+ jr.end_record # Make sure to end record.
48
+ # Display rendered image if render is completed, and the argument is true.
49
+ jr.display_rendered(true)
50
+ save_frame(format("%s%s", file_name, "_###.png"))
51
+ @count += 1
52
+ no_loop if (count > 120)
53
+ end
54
+
55
+ ```
56
+
57
+ ### The Animated Ray Trace Sketch
58
+ Now you hava a bunch of `*.png` images that you need to zip up to create a video
59
+
60
+ ```bash
61
+ png2yuv -j Animation_%0.3d.png -f 25 -I p -b 1 > tmp.yuv # zip it all up
62
+ ffmpeg2theora --optimize --videobitrate 16778 -o Animation.ogv tmp.yuv # convert
63
+ ```
64
+
65
+ <video src="/assets/Animation.ogv" poster="/assets/Animation.png" width="800" height="600" controls preload></video>
66
+
67
+
68
+ [fpsunflower]:http://sunflow.sourceforge.net/
69
+ [maven]:https://github.com/monkstone/sunflow
70
+ [joons]:https://github.com/joonhyublee/joons-renderer
71
+ [janino]:http://janino-compiler.github.io/janino/
72
+ [github]:https://github.com/monkstone/joonsrenderer
@@ -0,0 +1,78 @@
1
+ ---
2
+ layout: post
3
+ title: "Installing the gem"
4
+ date: 2017-01-08 06:31:13
5
+ categories: joonsrenderer update
6
+ ---
7
+
8
+ ### Requirements
9
+
10
+ Requires JRubyArt or propane
11
+
12
+ ### Install the joonsrenderer gem
13
+
14
+ ```bash
15
+ jgem install joonsrenderer # safe way
16
+ gem install joonsrenderer # using rvm rbenv to choose jruby
17
+ ```
18
+
19
+ Create basic sketch
20
+
21
+ ```bash
22
+ mkdir 'my_sketch'
23
+ cd my_sketch
24
+ k9 -c my_sketch 800 600 P3D # JRubyArt
25
+ propane -c my_sketch 800 600 P3D # propane
26
+ ```
27
+
28
+ Edit the JRubyArt sketch as follows:-
29
+
30
+ ```ruby
31
+ require 'joonsrender'
32
+ include_package 'joons'
33
+
34
+ attr_reader :jr, :eye, :center, :up
35
+
36
+ def setup
37
+ sketch_title 'My Sketch'
38
+ @jr = JoonsRenderer.new(self)
39
+ # Camera Setting.
40
+ @eye = Vec3D.new(0, 0, 120)
41
+ @center = Vec3D.new(0, 0, -1)
42
+ @up = Vec3D.new(0, 1, 0)
43
+ end
44
+
45
+ def draw
46
+ jr.begin_record # Make sure to include things you want rendered.
47
+ kamera(eye: eye, center: center, up: up)
48
+ perspektiv(fov: PI / 4.0, aspect_ratio: 4 / 3.0, near_z: 5, far_z: 10_000)
49
+ jr.background('cornell_box', 100, 100, 100) # Cornell Box: width, height, depth.
50
+ jr.background('gi_instant') # Global illumination.
51
+ translate(0, 10, -10)
52
+ rotate_y(-PI / 8)
53
+ rotate_x(-PI / 8)
54
+ jr.fill('diffuse', 255, 255, 255)
55
+ box(20)
56
+ jr.end_record # Make sure to end record.
57
+ jr.display_rendered(true) # Display rendered image if render is completed, and the argument is true.
58
+ end
59
+
60
+ def key_pressed
61
+ jr.render if (key == 'r' || key == 'R') # Press 'r' key to start rendering.
62
+ end
63
+
64
+ def settings
65
+ size(800, 600, P3D)
66
+ end
67
+
68
+ ```
69
+
70
+ ### The processing sketch ###
71
+
72
+ ![basic.png]({{site.github.url}}/assets/basic.png)
73
+
74
+ ### The raytraced output ###
75
+
76
+ ![basic_traced.png]({{site.github.url}}/assets/basic_traced.png)
77
+
78
+ Usage with propane is very similar
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Reset some basic elements
3
+ */
4
+ body, h1, h2, h3, h4, h5, h6,
5
+ p, blockquote, pre, hr,
6
+ dl, dd, ol, ul, figure {
7
+ margin: 0;
8
+ padding: 0;
9
+ }
10
+
11
+
12
+
13
+ /**
14
+ * Basic styling
15
+ */
16
+ body {
17
+ font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
18
+ color: $text-color;
19
+ background-color: $background-color;
20
+ -webkit-text-size-adjust: 100%;
21
+ -webkit-font-feature-settings: "kern" 1;
22
+ -moz-font-feature-settings: "kern" 1;
23
+ -o-font-feature-settings: "kern" 1;
24
+ font-feature-settings: "kern" 1;
25
+ font-kerning: normal;
26
+ }
27
+
28
+
29
+
30
+ /**
31
+ * Set `margin-bottom` to maintain vertical rhythm
32
+ */
33
+ h1, h2, h3, h4, h5, h6,
34
+ p, blockquote, pre,
35
+ ul, ol, dl, figure,
36
+ %vertical-rhythm {
37
+ margin-bottom: $spacing-unit / 2;
38
+ }
39
+
40
+
41
+
42
+ /**
43
+ * Images
44
+ */
45
+ img {
46
+ max-width: 100%;
47
+ vertical-align: middle;
48
+ }
49
+
50
+
51
+
52
+ /**
53
+ * Figures
54
+ */
55
+ figure > img {
56
+ display: block;
57
+ }
58
+
59
+ figcaption {
60
+ font-size: $small-font-size;
61
+ }
62
+
63
+
64
+
65
+ /**
66
+ * Lists
67
+ */
68
+ ul, ol {
69
+ margin-left: $spacing-unit;
70
+ }
71
+
72
+ li {
73
+ > ul,
74
+ > ol {
75
+ margin-bottom: 0;
76
+ }
77
+ }
78
+
79
+
80
+
81
+ /**
82
+ * Headings
83
+ */
84
+ h1, h2, h3, h4, h5, h6 {
85
+ font-weight: $base-font-weight;
86
+ }
87
+
88
+
89
+
90
+ /**
91
+ * Links
92
+ */
93
+ a {
94
+ color: $brand-color;
95
+ text-decoration: none;
96
+
97
+ &:visited {
98
+ color: darken($brand-color, 15%);
99
+ }
100
+
101
+ &:hover {
102
+ color: $text-color;
103
+ text-decoration: underline;
104
+ }
105
+ }
106
+
107
+
108
+
109
+ /**
110
+ * Blockquotes
111
+ */
112
+ blockquote {
113
+ color: $grey-color;
114
+ border-left: 4px solid $grey-color-light;
115
+ padding-left: $spacing-unit / 2;
116
+ font-size: 18px;
117
+ letter-spacing: -1px;
118
+ font-style: italic;
119
+
120
+ > :last-child {
121
+ margin-bottom: 0;
122
+ }
123
+ }
124
+
125
+
126
+
127
+ /**
128
+ * Code formatting
129
+ */
130
+ pre,
131
+ code {
132
+ font-size: 15px;
133
+ border: 1px solid $grey-color-light;
134
+ border-radius: 3px;
135
+ background-color: #eef;
136
+ }
137
+
138
+ code {
139
+ padding: 1px 5px;
140
+ }
141
+
142
+ pre {
143
+ padding: 8px 12px;
144
+ overflow-x: auto;
145
+
146
+ > code {
147
+ border: 0;
148
+ padding-right: 0;
149
+ padding-left: 0;
150
+ }
151
+ }
152
+
153
+
154
+
155
+ /**
156
+ * Wrapper
157
+ */
158
+ .wrapper {
159
+ max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2));
160
+ max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
161
+ margin-right: auto;
162
+ margin-left: auto;
163
+ padding-right: $spacing-unit;
164
+ padding-left: $spacing-unit;
165
+ @extend %clearfix;
166
+
167
+ @include media-query($on-laptop) {
168
+ max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
169
+ max-width: calc(#{$content-width} - (#{$spacing-unit}));
170
+ padding-right: $spacing-unit / 2;
171
+ padding-left: $spacing-unit / 2;
172
+ }
173
+ }
174
+
175
+
176
+
177
+ /**
178
+ * Clearfix
179
+ */
180
+ %clearfix {
181
+
182
+ &:after {
183
+ content: "";
184
+ display: table;
185
+ clear: both;
186
+ }
187
+ }
188
+
189
+
190
+
191
+ /**
192
+ * Icons
193
+ */
194
+ .icon {
195
+
196
+ > svg {
197
+ display: inline-block;
198
+ width: 16px;
199
+ height: 16px;
200
+ vertical-align: middle;
201
+
202
+ path {
203
+ fill: $grey-color;
204
+ }
205
+ }
206
+ }