rlm@73: #+title: First attempt at a creature! rlm@73: #+author: Robert McIntyre rlm@73: #+email: rlm@mit.edu rlm@73: #+description: rlm@73: #+keywords: simulation, jMonkeyEngine3, clojure rlm@73: #+SETUPFILE: ../../aurellem/org/setup.org rlm@73: #+INCLUDE: ../../aurellem/org/level-0.org rlm@73: rlm@73: * Intro rlm@73: So far, I've made the following senses -- rlm@73: - Vision rlm@73: - Hearing rlm@73: - Touch rlm@73: - Proprioception rlm@73: rlm@73: And one effector: rlm@73: - Movement rlm@73: rlm@73: However, the code so far has only enabled these senses, but has not rlm@73: actually implemented them. For example, there is still a lot of work rlm@73: to be done for vision. I need to be able to create an /eyeball/ in rlm@73: simulation that can be moved around and see the world from different rlm@73: angles. I also need to determine weather to use log-polar or cartesian rlm@73: for the visual input, and I need to determine how/wether to rlm@73: disceritise the visual input. rlm@73: rlm@73: I also want to be able to visualize both the sensors and the rlm@73: effectors in pretty pictures. This semi-retarted creature will by my rlm@73: first attempt at bringing everything together. rlm@73: rlm@73: * The creature's body rlm@73: rlm@73: Still going to do an eve-like body in blender, but due to problems rlm@73: importing the joints, etc into jMonkeyEngine3, I',m going to do all rlm@73: the connecting here in clojure code, using the names of the individual rlm@73: components and trial and error. Later, I'll maybe make some sort of rlm@73: creature-building modifications to blender that support whatever rlm@73: discreitized senses I'm going to make. rlm@73: rlm@73: #+name: body-1 rlm@73: #+begin_src clojure rlm@73: (ns cortex.silly rlm@73: "let's play!" rlm@73: {:author "Robert McIntyre"}) rlm@73: rlm@73: ;; TODO remove this! rlm@73: (require 'cortex.import) rlm@73: (cortex.import/mega-import-jme3) rlm@73: (use '(cortex world util body hearing touch vision)) rlm@73: rlm@73: (use '[clojure.contrib [seq :only [find-first]]]) rlm@73: rlm@73: rlm@73: (rlm.rlm-commands/help) rlm@73: rlm@73: (defn load-blender-model rlm@73: "Load a .blend file using an asset folder relative path." rlm@73: [^String model] rlm@73: (.loadModel rlm@73: (doto (asset-manager) rlm@73: (.registerLoader BlenderModelLoader (into-array String ["blend"]))) rlm@73: model)) rlm@73: rlm@73: rlm@73: (defn apply-skeleton rlm@73: "Given an imported blender model, apply the armature using the rlm@73: following pattern: if two bones are connected and have the same rlm@73: names as two shapes, connect the shapes with a joint constraint." rlm@73: [armature-name creature] rlm@73: rlm@73: rlm@73: rlm@73: #+end_src rlm@73: rlm@73: rlm@73: rlm@73: * COMMENT generate source rlm@73: #+begin_src clojure :tangle ../src/cortex/silly.clj rlm@73: <> rlm@73: #+end_src rlm@73: