diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/org/test-creature.org	Wed Dec 28 00:00:23 2011 -0700
     1.3 @@ -0,0 +1,81 @@
     1.4 +#+title: First attempt at a creature!
     1.5 +#+author: Robert McIntyre
     1.6 +#+email: rlm@mit.edu
     1.7 +#+description: 
     1.8 +#+keywords: simulation, jMonkeyEngine3, clojure
     1.9 +#+SETUPFILE: ../../aurellem/org/setup.org
    1.10 +#+INCLUDE: ../../aurellem/org/level-0.org
    1.11 +
    1.12 +* Intro 
    1.13 +So far, I've made the following senses -- 
    1.14 + - Vision
    1.15 + - Hearing
    1.16 + - Touch
    1.17 + - Proprioception
    1.18 +
    1.19 +And one effector: 
    1.20 + - Movement
    1.21 +
    1.22 +However, the code so far has only enabled these senses, but has not
    1.23 +actually implemented them.  For example, there is still a lot of work
    1.24 +to be done for vision. I need to be able to create an /eyeball/ in
    1.25 +simulation that can be moved around and see the world from different
    1.26 +angles. I also need to determine weather to use log-polar or cartesian
    1.27 +for the visual input, and I need to determine how/wether to
    1.28 +disceritise the visual input.
    1.29 +
    1.30 +I also want to be able to visualize both the sensors and the
    1.31 +effectors in pretty pictures. This semi-retarted creature will by my
    1.32 +first attempt at bringing everything together.
    1.33 +
    1.34 +* The creature's body
    1.35 +
    1.36 +Still going to do an eve-like body in blender, but due to problems
    1.37 +importing the joints, etc into jMonkeyEngine3, I',m going to do all
    1.38 +the connecting here in clojure code, using the names of the individual
    1.39 +components and trial and error. Later, I'll maybe make some sort of
    1.40 +creature-building modifications to blender that support whatever
    1.41 +discreitized senses I'm going to make.
    1.42 +
    1.43 +#+name: body-1
    1.44 +#+begin_src clojure 
    1.45 +(ns cortex.silly
    1.46 +  "let's play!"
    1.47 +  {:author "Robert McIntyre"})
    1.48 +
    1.49 +;; TODO remove this!
    1.50 +(require 'cortex.import)
    1.51 +(cortex.import/mega-import-jme3)
    1.52 +(use '(cortex world util body hearing touch vision))
    1.53 +
    1.54 +(use '[clojure.contrib [seq :only [find-first]]])
    1.55 +
    1.56 +
    1.57 +(rlm.rlm-commands/help)
    1.58 +
    1.59 +(defn load-blender-model
    1.60 +  "Load a .blend file using an asset folder relative path."
    1.61 +  [^String model]
    1.62 +  (.loadModel
    1.63 +   (doto (asset-manager)
    1.64 +     (.registerLoader BlenderModelLoader (into-array String ["blend"])))
    1.65 +   model))
    1.66 +
    1.67 +
    1.68 +(defn apply-skeleton
    1.69 +  "Given an imported blender model, apply the armature using the
    1.70 +  following pattern: if two bones are connected and have the same
    1.71 +  names as two shapes, connect the shapes with a joint constraint."
    1.72 +  [armature-name creature]
    1.73 +  
    1.74 +
    1.75 +
    1.76 +#+end_src
    1.77 +
    1.78 +
    1.79 +
    1.80 +* COMMENT generate source
    1.81 +#+begin_src clojure :tangle ../src/cortex/silly.clj
    1.82 +<<body-1>>
    1.83 +#+end_src
    1.84 +