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