comparison org/test-creature.org @ 73:257a86328adb

saving progress
author Robert McIntyre <rlm@mit.edu>
date Wed, 28 Dec 2011 00:00:23 -0700
parents
children fb810a2c50c2
comparison
equal deleted inserted replaced
72:6f1c86126d51 73:257a86328adb
1 #+title: First attempt at a creature!
2 #+author: Robert McIntyre
3 #+email: rlm@mit.edu
4 #+description:
5 #+keywords: simulation, jMonkeyEngine3, clojure
6 #+SETUPFILE: ../../aurellem/org/setup.org
7 #+INCLUDE: ../../aurellem/org/level-0.org
8
9 * Intro
10 So far, I've made the following senses --
11 - Vision
12 - Hearing
13 - Touch
14 - Proprioception
15
16 And one effector:
17 - Movement
18
19 However, the code so far has only enabled these senses, but has not
20 actually implemented them. For example, there is still a lot of work
21 to be done for vision. I need to be able to create an /eyeball/ in
22 simulation that can be moved around and see the world from different
23 angles. I also need to determine weather to use log-polar or cartesian
24 for the visual input, and I need to determine how/wether to
25 disceritise the visual input.
26
27 I also want to be able to visualize both the sensors and the
28 effectors in pretty pictures. This semi-retarted creature will by my
29 first attempt at bringing everything together.
30
31 * The creature's body
32
33 Still going to do an eve-like body in blender, but due to problems
34 importing the joints, etc into jMonkeyEngine3, I',m going to do all
35 the connecting here in clojure code, using the names of the individual
36 components and trial and error. Later, I'll maybe make some sort of
37 creature-building modifications to blender that support whatever
38 discreitized senses I'm going to make.
39
40 #+name: body-1
41 #+begin_src clojure
42 (ns cortex.silly
43 "let's play!"
44 {:author "Robert McIntyre"})
45
46 ;; TODO remove this!
47 (require 'cortex.import)
48 (cortex.import/mega-import-jme3)
49 (use '(cortex world util body hearing touch vision))
50
51 (use '[clojure.contrib [seq :only [find-first]]])
52
53
54 (rlm.rlm-commands/help)
55
56 (defn load-blender-model
57 "Load a .blend file using an asset folder relative path."
58 [^String model]
59 (.loadModel
60 (doto (asset-manager)
61 (.registerLoader BlenderModelLoader (into-array String ["blend"])))
62 model))
63
64
65 (defn apply-skeleton
66 "Given an imported blender model, apply the armature using the
67 following pattern: if two bones are connected and have the same
68 names as two shapes, connect the shapes with a joint constraint."
69 [armature-name creature]
70
71
72
73 #+end_src
74
75
76
77 * COMMENT generate source
78 #+begin_src clojure :tangle ../src/cortex/silly.clj
79 <<body-1>>
80 #+end_src
81