Mercurial > cortex
view org/games.org @ 31:f0562b9bde94
fixed picture links
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 24 Oct 2011 12:54:04 -0700 |
parents | 0206878c28b4 |
children | 183744c179e6 |
line wrap: on
line source
1 #+title: Games! Games! Games! <32 #+author: Robert McIntyre3 #+email: rlm@mit.edu4 #+description: Simulating senses for AI research using JMonkeyEngine35 #+SETUPFILE: ../../aurellem/org/setup.org6 #+INCLUDE: ../../aurellem/org/level-0.org7 #+babel: :mkdirp yes :noweb yes :exports both10 * Games!12 Here are the jMonkeyEngine "Hello" programs translated to clojure.13 ** Hello Simple App14 Here is the hello world example for jme3 in clojure. It's a more or15 less direct translation from the java source [[http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication][here]].17 Of note is the fact that since we don't have access to the18 =AssetManager= via extendig =SimpleApplication=, we have to build one19 ourselves.21 #+srcname: hello-simple-app22 #+begin_src clojure :results silent23 (ns hello.hello-simple-app)24 (require 'cortex.import)25 (use 'clojure.contrib.def)26 (rlm.rlm-commands/help)27 (cortex.import/mega-import-jme3)28 (use 'cortex.world)31 (def cube (Box. Vector3f/ZERO 1 1 1))33 (def geom (Geometry. "Box" cube))35 (def mat (Material. (asset-manager) "Common/MatDefs/Misc/Unshaded.j3md"))37 (.setColor mat "Color" ColorRGBA/Blue)39 (.setMaterial geom mat)41 (defn simple-app []42 (doto43 (proxy [SimpleApplication] []44 (simpleInitApp45 []46 ;; Don't take control of the mouse47 (org.lwjgl.input.Mouse/setGrabbed false)48 (.attachChild (.getRootNode this) geom)))49 ;; don't show a menu to change options.50 (.setShowSettings false)51 (.setPauseOnLostFocus false)52 (.setSettings *app-settings*)))53 #+end_src55 Running this program will begin a new jMonkeyEngine game which56 displays a single blue cube.58 #+begin_src clojure :exports code :results silent59 (.start (hello.hello-simple-app/simple-app))60 #+end_src62 #+caption: the simplest JME game.63 [[../images/simple-app.jpg]]66 ** Hello Physics67 From http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_physics69 #+srcname: brick-wall-header70 #+begin_src clojure :results silent71 (ns hello.brick-wall)72 (require 'cortex.import)73 (use 'clojure.contrib.def)74 (rlm.rlm-commands/help)75 (cortex.import/mega-import-jme3)76 (use '[pokemon [lpsolve :only [constant-map]]])77 (use 'cortex.world)78 (use 'cortex.util)79 #+end_src81 #+srcname: brick-wall-body82 #+begin_src clojure :results silent83 (in-ns 'hello.brick-wall)85 (defn floor86 "make a sturdy, unmovable physical floor"87 []88 (box 20 1 20 :mass 0 :color false :position (Vector3f. 0 -2 0)))90 (def brick-length 0.48)91 (def brick-width 0.24)92 (def brick-height 0.12)95 (defn brick* [position]96 (doto (box brick-length brick-height brick-width97 :position position :name "brick"98 :material "Common/MatDefs/Misc/Unshaded.j3md"99 :texture "Textures/Terrain/BrickWall/BrickWall.jpg"100 :mass 36)101 (->102 (.getMesh)103 (.scaleTextureCoordinates (Vector2f. 1 0.5)))104 ;;(.setShadowMode RenderQueue$ShadowMode/CastAndReceive)105 )106 )108 (defn inception-brick-wall109 "construct a physical brick wall"110 []111 (let [node (Node. "brick-wall")]112 (dorun113 (map (comp #(.attachChild node %) brick*)114 (for115 [x (range 15)116 y (range 10)117 z (range 1)]118 (Vector3f.119 (* brick-length x 1.03)120 (* brick-width y y 10)121 (* brick-height z)))))122 node))124 (defn gravity-toggle125 [new-value]126 (fn [game value]127 (println-repl "set gravity to " new-value)128 (if value129 (set-gravity* game new-value)130 (set-gravity* game gravity))))132 (defn fire-cannon-ball133 ([node]134 (fn [game value]135 (if (not value)136 (let [camera (.getCamera game)137 cannon-ball138 (sphere 0.7139 :material "Common/MatDefs/Misc/Unshaded.j3md"140 :texture "Textures/PokeCopper.jpg"141 :position142 (.add (.getLocation camera)143 (.mult (.getDirection camera) (float 1)))144 :mass 3)] ;200 0.05145 (.setShadowMode cannon-ball RenderQueue$ShadowMode/CastAndReceive)146 (.setLinearVelocity147 (.getControl cannon-ball RigidBodyControl)148 (.mult (.getDirection camera) (float 50))) ;50149 (add-element game cannon-ball (if node node (.getRootNode game)))))))150 ([]151 (fire-cannon-ball false)))154 (defn floor* []155 (doto (box 10 0.1 5 :name "floor" ;10 0.1 5 ; 240 0.1 240156 :material "Common/MatDefs/Misc/Unshaded.j3md"157 :texture "Textures/Terrain/Pond/Pond.png"158 :position (Vector3f. 0 -0.1 0 )159 :mass 0)160 (->161 (.getMesh)162 (.scaleTextureCoordinates (Vector2f. 3 6)));64 64163 (->164 (.getMaterial)165 (.getTextureParam "ColorMap")166 (.getTextureValue)167 (.setWrap Texture$WrapMode/Repeat))168 (.setShadowMode RenderQueue$ShadowMode/Receive)169 ))171 (defn brick-wall* []172 (let [node (Node. "brick-wall")]173 (dorun174 (map175 (comp #(.attachChild node %) brick*)176 (for [y (range 15)177 x (range 4)178 z (range 1)]179 (Vector3f.180 (+ (* 2 x brick-length)181 (if (even? (+ y z))182 (/ brick-length 4) (/ brick-length -4)))183 (+ (* brick-height (inc (* 2 y))))184 (* 2 z brick-width) ))))185 (.setShadowMode node RenderQueue$ShadowMode/CastAndReceive)186 node))188 (defn brick-wall-game-run []189 (doto190 (world191 (doto (Node.) (.attachChild (floor*))192 (.attachChild (brick-wall*))193 )194 {"key-i" (gravity-toggle (Vector3f. 0 0 -9.81))195 "key-m" (gravity-toggle (Vector3f. 0 0 9.81))196 "key-l" (gravity-toggle (Vector3f. 9.81 0 0))197 "key-j" (gravity-toggle (Vector3f. -9.81 0 0))198 "key-k" (gravity-toggle Vector3f/ZERO)199 "key-u" (gravity-toggle (Vector3f. 0 9.81 0))200 "key-o" (gravity-toggle (Vector3f. 0 -9.81 0))201 "key-f" (fn[game value]202 (if (not value) (add-element game (brick-wall*))))203 "key-return" (fire-cannon-ball)}204 position-camera205 (fn [& _]))206 (.start)))207 #+end_src209 #+begin_src clojure :results silent210 (hello.brick-wall/brick-wall-game-run)211 #+end_src213 #+caption: the brick wall standing214 [[../images/brick-wall-standing.jpg]]216 #+caption: the brick wall after it has been knocked over by a "pok\eacute{}ball"217 [[../images/brick-wall-knocked-down.jpg]]219 ** Other Brick Games220 #+srcname: other-games221 #+begin_src clojure :results silent222 (ns cortex.other-games223 {:author "Dylan Holmes"})224 (use 'cortex.world)225 (use 'hello.brick-wall)226 (use 'cortex.import)227 (cortex.import/mega-import-jme3)229 (defn scad [position]230 (doto (box 0.1 0.1 0.1231 :position position :name "brick"232 :material "Common/MatDefs/Misc/Unshaded.j3md"233 :texture "Textures/Terrain/BrickWall/BrickWall.jpg"234 :mass 20)235 (->236 (.getMesh)237 (.scaleTextureCoordinates (Vector2f. 1 0.5))238 )239 (-> (.getControl RigidBodyControl)240 (.setLinearVelocity (Vector3f. 0 100 0))241 )243 ;;(.setShadowMode RenderQueue$ShadowMode/Cast)244 ))247 (defn shrapnel []248 (let [node (Node. "explosion-day")]249 (dorun250 (map251 (comp #(.attachChild node %) scad)252 (for [y (range 15)253 x (range 4)254 z (range 1)]255 (Vector3f.256 (+ (* 2 x brick-height)257 (if (even? (+ y z)) (/ brick-height 4) (/ brick-height -4)))258 (+ (* brick-height (inc (* 2 y))))259 (* 2 z brick-height) ))))260 node))263 (def domino-height 0.48)264 (def domino-thickness 0.12)265 (def domino-width 0.24)267 (def domino-thickness 0.05)268 (def domino-width 0.5)269 (def domino-height 1)271 (defn domino272 ([position]273 (domino position (Quaternion/IDENTITY)))274 ([position rotation]275 (doto (box domino-width domino-height domino-thickness276 :position position :name "domino"277 :material "Common/MatDefs/Misc/Unshaded.j3md"278 :texture "Textures/Terrain/BrickWall/BrickWall.jpg"279 :mass 1280 :rotation rotation)281 (.setShadowMode RenderQueue$ShadowMode/CastAndReceive)282 )))285 (defn domino-row []286 (let [node (Node. "domino-row")]287 (dorun288 (map289 (comp #(.attachChild node %) domino)290 (for [291 z (range 10)292 x (range 5)293 ]294 (Vector3f.295 (+ (* z domino-width) (* x 5 domino-width))296 (/ domino-height 1)297 (* -5.5 domino-thickness z) ))))299 node))301 (defn domino-cycle []302 (let [node (Node. "domino-cycle")]303 (dorun304 (map305 (comp #(.attachChild node %) (partial apply domino) )306 (for [n (range 720)]307 (let [space (* domino-height 5.5)308 r (fn[n] (* (+ n 3) domino-width 0.5))309 t (fn[n] (reduce310 +311 (map312 (fn dt[n] (/ space (* 2 (Math/PI) (r n))))313 (range n))))314 t (t n)315 r (r n)316 ct (Math/cos t)317 st (Math/sin t)318 ]319 (list320 (Vector3f.321 (* -1 r st)322 (/ domino-height 1)323 (* r ct))324 (.fromAngleAxis (Quaternion.)325 (- (/ 3.1415926 2) t) (Vector3f. 0 1 0))326 )))327 ))328 node))331 (defn domino-game-run []332 (doto333 (world334 (doto (Node.) (.attachChild (floor*))335 )336 {"key-i" (gravity-toggle (Vector3f. 0 0 -9.81))337 "key-m" (gravity-toggle (Vector3f. 0 0 9.81))338 "key-l" (gravity-toggle (Vector3f. 9.81 0 0))339 "key-j" (gravity-toggle (Vector3f. -9.81 0 0))340 "key-k" (gravity-toggle (Vector3f. 0 9.81 0) )341 "key-u" (fn[g v] ((gravity-toggle (Vector3f. 0 -0 0)) g true))342 "key-o" (gravity-toggle (Vector3f. 0 -9.81 0))344 "key-space"345 (fn[game value]347 (if (not value)348 (let [d (domino (Vector3f. 0 (/ domino-height 0.25) 0)349 (.fromAngleAxis (Quaternion.)350 (/ Math/PI 2) (Vector3f. 0 1 0)))]351 (add-element game d))))352 "key-f"353 (fn[game value](if (not value) (add-element game (domino-cycle))))354 "key-return" (fire-cannon-ball)}355 position-camera356 (fn [& _]))357 (.start)))358 #+end_src360 #+begin_src clojure :results silent361 (cortex.other-games/domino-game-run)362 #+end_src364 #+caption: floating dominos365 [[../images/dominos.jpg]]367 ** Hello Loop368 #+srcname: hello-loop369 #+begin_src clojure :results silent370 (ns hello.loop)371 (use 'cortex.world)372 (use 'cortex.import)373 (cortex.import/mega-import-jme3)374 (rlm.rlm-commands/help)376 (defn blue-cube []377 (box 1 1 1378 :color ColorRGBA/Blue379 :texture false380 :material "Common/MatDefs/Misc/Unshaded.j3md"381 :name "blue-cube"382 :physical? false))384 (defn blue-cube-game []385 (let [cube (blue-cube)386 root (doto (Node.) (.attachChild cube))]387 (world root388 {}389 no-op390 (fn [game tpf]391 (.rotate cube 0.0 (* 2 tpf) 0.0)))))392 #+end_src394 ** Hello Collision396 #+srcname: hello-collision397 #+begin_src clojure :results silent398 (ns hello.collision)399 (use 'cortex.world)400 (use 'cortex.import)401 (use 'clojure.contrib.def)404 (cortex.import/mega-import-jme3)405 (rlm.rlm-commands/help)406 (use '[hello [brick-wall :only [fire-cannon-ball brick-wall*]]])409 (defn environment []410 (let411 [scene-model412 (doto413 (.loadModel414 (doto (asset-manager)415 (.registerLocator416 "/home/r/cortex/assets/zips/town.zip" ZipLocator))417 "main.scene")418 (.setLocalScale (float 2.0)))419 collision-shape420 (CollisionShapeFactory/createMeshShape #^Node scene-model)421 landscape (RigidBodyControl. collision-shape 0)]422 (.setShadowMode scene-model RenderQueue$ShadowMode/CastAndReceive)423 (.addControl scene-model landscape)424 scene-model))426 (defn player-fn []427 (doto428 (CharacterControl.429 (CapsuleCollisionShape. (float 1.5) (float 6)(float 1))430 (float 0.05))431 (.setJumpSpeed 20)432 (.setFallSpeed 30)433 (.setGravity 30) ;30434 (.setPhysicsLocation (Vector3f. 0 10 0))))436 (defn lights []437 [(doto (AmbientLight.) (.setColor (.mult (ColorRGBA. 1 1 1 1) (float 1))))438 (doto (AmbientLight.) (.setColor (.mult (ColorRGBA. 1 0.7 0 1) (float 1))))439 (doto (DirectionalLight.)440 (.setColor (.mult ColorRGBA/White (float 0.9) ))441 (.setDirection (.normalizeLocal (Vector3f. 2.8 -28 2.8))))])443 (defn night-lights []444 [(doto (AmbientLight.) (.setColor (.mult (ColorRGBA. 0.275 0.467 0.784 1) (float 0.3))))445 (doto (DirectionalLight.)446 (.setColor (.mult ColorRGBA/White (float 0.2) ))447 (.setDirection (.normalizeLocal (Vector3f. 2.8 -28 2.8))))])449 (def player (atom (player-fn)))451 (defn setup-fn [game]452 (dorun (map #(.addLight (.getRootNode game) %) (lights)))453 ;; set the color of the sky454 (.setBackgroundColor (.getViewPort game) (ColorRGBA. 0.3 0.4 0.9 1))455 ;(.setBackgroundColor (.getViewPort game) (ColorRGBA. 0 0 0 1)456 (doto (.getFlyByCamera game)457 (.setMoveSpeed (float 100))458 (.setRotationSpeed 3))459 (.add460 (.getPhysicsSpace461 (.getState (.getStateManager game) BulletAppState))462 @player)464 (doto (Node.) (.attachChild (.getRootNode game))465 (.attachChild (brick-wall*))466 )468 )471 (def walking-up? (atom false))472 (def walking-down? (atom false))473 (def walking-left? (atom false))474 (def walking-right? (atom false))476 (defn set-walk [walk-atom game value]477 ;;(println-repl "setting stuff to " value)478 (reset! walk-atom value))480 (defn responses []481 {"key-w" (partial set-walk walking-up?)482 "key-d" (partial set-walk walking-right?)483 "key-s" (partial set-walk walking-down?)484 "key-a" (partial set-walk walking-left?)485 "key-return" (fire-cannon-ball)486 "key-space" (fn [game value] (.jump @player))487 })489 (defn update-fn490 [game tpf]491 (let [camera (.getCamera game)492 cam-dir (.multLocal493 (.clone494 (.getDirection camera)) (float 0.6))495 cam-left (.multLocal496 (.clone497 (.getLeft camera)) (float 0.4))498 walk-direction (Vector3f. 0 0 0)]500 (cond501 @walking-up? (.addLocal walk-direction cam-dir)502 @walking-right? (.addLocal walk-direction (.negate cam-left))503 @walking-down? (.addLocal walk-direction (.negate cam-dir))504 @walking-left? (.addLocal walk-direction cam-left))505 (.setWalkDirection @player walk-direction)506 (.setLocation camera (.getPhysicsLocation @player))))508 (defn run-game []509 (.start510 (world (environment)511 (responses)512 setup-fn513 update-fn)))514 #+end_src516 ** Hello Terrain517 #+srcname: hello-terrain518 #+begin_src clojure :results silent519 (ns hello.terrain)520 (use 'cortex.world)521 (use 'cortex.import)522 (use 'clojure.contrib.def)523 (import jme3tools.converters.ImageToAwt)526 (cortex.import/mega-import-jme3)527 (rlm.rlm-commands/help)528 (use '[hello [brick-wall :only [fire-cannon-ball brick-wall*]]])531 (defn setup-fn [type game]532 (.setMoveSpeed (.getFlyByCamera game) 50)533 (.setFrustumFar (.getCamera game) 10000)534 (let [env (environment type)535 cameras [(.getCamera game)]536 control (TerrainLodControl. env cameras)]537 ;;(.addControl env control)538 (.attachChild (.getRootNode game) env)))540 (defn environment [type]541 (let542 [mat_terrain543 (Material. (asset-manager) "Common/MatDefs/Terrain/Terrain.j3md")544 grass (.loadTexture (asset-manager) "Textures/Terrain/splat/grass.jpg")545 dirt (.loadTexture (asset-manager) "Textures/Terrain/splat/dirt.jpg")546 rock (.loadTexture (asset-manager) "Textures/Terrain/splat/road.jpg")547 heightmap-image (.loadTexture (asset-manager)548 ({:mountain "Textures/Terrain/splat/mountains512.png"549 :fortress "Textures/Terrain/splat/fortress512.png"550 }type))551 heightmap (ImageBasedHeightMap.552 (ImageToAwt/convert (.getImage heightmap-image) false true 0))553 terrain (do (.load heightmap)554 (TerrainQuad. "my terrain" 65 513 (.getHeightMap heightmap)))555 ]557 (dorun (map #(.setWrap % Texture$WrapMode/Repeat)558 [grass dirt rock]))560 (doto mat_terrain561 (.setTexture "Tex1" grass)562 (.setFloat "Tex1Scale" (float 64))564 (.setTexture "Tex2" dirt)565 (.setFloat "Tex2Scale" (float 32))567 (.setTexture "Tex3" rock)568 (.setFloat "Tex3Scale" (float 128))570 (.setTexture "Alpha"571 (.loadTexture572 (asset-manager)573 ({:mountain "Textures/Terrain/splat/alphamap.png"574 :fortress "Textures/Terrain/splat/alphamap2.png"} type))))576 (doto terrain577 (.setMaterial mat_terrain)578 (.setLocalTranslation 0 -100 0)579 (.setLocalScale 2 1 2))))583 (defn run-terrain-game [type]584 (.start585 (world586 (Node.)587 {}588 (partial setup-fn type)589 no-op)))590 #+end_src594 #+srcname: hello-animation595 #+begin_src clojure :results silent596 (ns hello.animation)597 (use 'cortex.world)598 (use 'cortex.import)599 (use 'clojure.contrib.def)600 (cortex.import/mega-import-jme3)601 (rlm.rlm-commands/help)602 (use '[hello [collision :only [lights]]])604 (defn stand605 [channel]606 (doto channel607 (.setAnim "stand" (float 0.5))608 (.setLoopMode LoopMode/DontLoop)609 (.setSpeed (float 1))))611 (defn anim-listener []612 (proxy [AnimEventListener] []613 (onAnimChange614 [control channel animation-name]615 (println-repl "RLM --- onAnimChange"))616 (onAnimCycleDone617 [control channel animation-name]618 (if (= animation-name "Walk")619 (stand channel)620 ))))622 (defn setup-fn [channel game]623 (dorun (map #(.addLight (.getRootNode game) %) (lights)))624 ;; set the color of the sky625 (.setBackgroundColor (.getViewPort game) (ColorRGBA. 0.3 0.4 0.9 1))626 ;(.setBackgroundColor (.getViewPort game) (ColorRGBA. 0 0 0 1)627 (.setAnim channel "stand")628 (doto (.getFlyByCamera game)629 (.setMoveSpeed (float 10))630 (.setRotationSpeed 1)))632 (defn walk [channel]633 (println-repl "zzz")634 (doto channel635 (.setAnim "Walk" (float 0.5))636 (.setLoopMode LoopMode/Loop)))639 (defn key-map [channel]640 {"key-space" (fn [game value]641 (if (not value)642 (walk channel)))})644 (defn player []645 (let [model (.loadModel (asset-manager) "Models/Oto/Oto.mesh.xml")646 control (.getControl model AnimControl)]647 (.setLocalScale model (float 0.5))648 (.clearListeners control)649 (.addListener control (anim-control))650 model))654 (defn run-anim-game []655 (let [ninja (player)656 control (.getControl ninja AnimControl)657 channel (.createChannel control)]658 (.start659 (world660 ninja661 (key-map channel)662 (partial setup-fn channel)663 no-op))))664 #+end_src666 ** Hello Materials667 #+srcname: material668 #+begin_src clojure :results silent669 (ns hello.material)670 (use 'cortex.world)671 (use 'cortex.import)672 (use 'clojure.contrib.def)673 (cortex.import/mega-import-jme3)674 (rlm.rlm-commands/help)676 (defn simple-cube []677 (box 1 1 1678 :position (Vector3f. -3 1.1 0)679 :material "Common/MatDefs/Misc/Unshaded.j3md"680 :texture "Interface/Logo/Monkey.jpg"681 :physical? false))683 (defn leaky-box []684 (box 1 1 1685 :position (Vector3f. 3 -1 0)686 :material "Common/MatDefs/Misc/ColoredTextured.j3md"687 :texture "Textures/ColoredTex/Monkey.png"688 :color (ColorRGBA. 1 0 1 1)689 :physical? false))691 (defn transparent-box []692 (doto693 (box 1 1 0.1694 :position Vector3f/ZERO695 :name "window frame"696 :material "Common/MatDefs/Misc/Unshaded.j3md"697 :texture "Textures/ColoredTex/Monkey.png"698 :physical? false)699 (-> (.getMaterial)700 (.getAdditionalRenderState)701 (.setBlendMode RenderState$BlendMode/Alpha))702 (.setQueueBucket RenderQueue$Bucket/Transparent)))704 (defn bumpy-sphere []705 (doto706 (sphere 2707 :position (Vector3f. 0 2 -2)708 :name "Shiny rock"709 :material "Common/MatDefs/Light/Lighting.j3md"710 :texture false711 :physical? false)712 (-> (.getMesh)713 (doto714 (.setTextureMode Sphere$TextureMode/Projected)715 (TangentBinormalGenerator/generate)))716 (-> (.getMaterial)717 (doto718 (.setTexture "DiffuseMap"719 (.loadTexture (asset-manager)720 "Textures/Terrain/Pond/Pond.png"))721 (.setTexture "NormalMap"722 (.loadTexture (asset-manager)723 "Textures/Terrain/Pond/Pond_normal.png"))724 (.setFloat "Shininess" (float 5))))725 (.rotate (float 1.6) 0 0)))728 (defn start-game []729 (.start730 (world731 (let [root (Node.)]732 (dorun (map #(.attachChild root %)733 [(simple-cube) (leaky-box) (transparent-box) (bumpy-sphere)]))734 root)735 {}736 (fn [world]737 (let [sun (doto (DirectionalLight.)738 (.setDirection (.normalizeLocal (Vector3f. 1 0 -2)))739 (.setColor ColorRGBA/White))]740 (.addLight (.getRootNode world) sun)))741 no-op742 )))743 #+end_src747 * COMMENT code generation749 #+begin_src clojure :tangle ../src/hello/brick_wall.clj750 <<brick-wall-header>>751 <<brick-wall-body>>752 #+end_src754 #+begin_src clojure :tangle ../src/hello/hello_simple_app.clj755 <<hello-simple-app>>756 #+end_src758 #+begin_src clojure :tangle ../src/cortex/other_games.clj759 <<other-games>>760 #+end_src762 #+begin_src clojure :tangle ../src/hello/loop.clj763 <<hello-loop>>764 #+end_src766 #+begin_src clojure :tangle ../src/hello/collision.clj767 <<hello-collision>>768 #+end_src770 #+begin_src clojure :tangle ../src/hello/terrain.clj771 <<hello-terrain>>772 #+end_src774 #+begin_src clojure :tangle ../src/hello/animation.clj775 <<hello-animation>>776 #+end_src778 #+begin_src clojure :tangle ../src/hello/material.clj779 <<material>>780 #+end_src