Mercurial > cortex
comparison org/vision.org @ 317:bb3f8a4af87f
removed references to defvar from clojure.contrib.def since the def from 1.4 now allows for docstrings
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 28 Feb 2012 14:04:21 -0600 |
parents | 2c7fbcbd5ebb |
children | 702b5c78c2de |
comparison
equal
deleted
inserted
replaced
316:2c7fbcbd5ebb | 317:bb3f8a4af87f |
---|---|
222 For convenience I've defined a few symbols for the more common | 222 For convenience I've defined a few symbols for the more common |
223 sensitivity values. | 223 sensitivity values. |
224 | 224 |
225 #+name: sensitivity | 225 #+name: sensitivity |
226 #+begin_src clojure | 226 #+begin_src clojure |
227 (defvar sensitivity-presets | 227 (def sensitivity-presets |
228 "Retinal sensitivity presets for sensors that extract one channel | |
229 (:red :blue :green) or average all channels (:all)" | |
228 {:all 0xFFFFFF | 230 {:all 0xFFFFFF |
229 :red 0xFF0000 | 231 :red 0xFF0000 |
230 :blue 0x0000FF | 232 :blue 0x0000FF |
231 :green 0x00FF00} | 233 :green 0x00FF00}) |
232 "Retinal sensitivity presets for sensors that extract one channel | |
233 (:red :blue :green) or average all channels (:all)") | |
234 #+end_src | 234 #+end_src |
235 | 235 |
236 ** Metadata Processing | 236 ** Metadata Processing |
237 | 237 |
238 =retina-sensor-profile= extracts a map from the eye-node in the same | 238 =retina-sensor-profile= extracts a map from the eye-node in the same |
266 * Importing and parsing descriptions of eyes. | 266 * Importing and parsing descriptions of eyes. |
267 First off, get the children of the "eyes" empty node to find all the | 267 First off, get the children of the "eyes" empty node to find all the |
268 eyes the creature has. | 268 eyes the creature has. |
269 #+name: eye-node | 269 #+name: eye-node |
270 #+begin_src clojure | 270 #+begin_src clojure |
271 (defvar | 271 (def |
272 ^{:arglists '([creature])} | 272 ^{:doc "Return the children of the creature's \"eyes\" node." |
273 :arglists '([creature])} | |
273 eyes | 274 eyes |
274 (sense-nodes "eyes") | 275 (sense-nodes "eyes")) |
275 "Return the children of the creature's \"eyes\" node.") | |
276 #+end_src | 276 #+end_src |
277 | 277 |
278 Then, add the camera created by =add-eye!= to the simulation by | 278 Then, add the camera created by =add-eye!= to the simulation by |
279 creating a new viewport. | 279 creating a new viewport. |
280 | 280 |
690 the observed data to any arbitrary function. Automatically reads | 690 the observed data to any arbitrary function. Automatically reads |
691 eye-nodes from specially prepared blender files and instantiates | 691 eye-nodes from specially prepared blender files and instantiates |
692 them in the world as actual eyes." | 692 them in the world as actual eyes." |
693 {:author "Robert McIntyre"} | 693 {:author "Robert McIntyre"} |
694 (:use (cortex world sense util)) | 694 (:use (cortex world sense util)) |
695 (:use clojure.contrib.def) | |
696 (:import com.jme3.post.SceneProcessor) | 695 (:import com.jme3.post.SceneProcessor) |
697 (:import (com.jme3.util BufferUtils Screenshots)) | 696 (:import (com.jme3.util BufferUtils Screenshots)) |
698 (:import java.nio.ByteBuffer) | 697 (:import java.nio.ByteBuffer) |
699 (:import java.awt.image.BufferedImage) | 698 (:import java.awt.image.BufferedImage) |
700 (:import (com.jme3.renderer ViewPort Camera)) | 699 (:import (com.jme3.renderer ViewPort Camera)) |