comparison org/vision.org @ 337:fdc98824d69b

working on problem with vision.
author Robert McIntyre <rlm@mit.edu>
date Fri, 20 Jul 2012 13:14:22 -0500
parents 5dcd44576cbc
children d37ccb6c888f
comparison
equal deleted inserted replaced
336:70469ff8eb56 337:fdc98824d69b
560 560
561 ([] (test-worm-vision false)) 561 ([] (test-worm-vision false))
562 ([record?] 562 ([record?]
563 (let [the-worm (doto (worm)(body!)) 563 (let [the-worm (doto (worm)(body!))
564 vision (vision! the-worm) 564 vision (vision! the-worm)
565 vision-display (view-vision) 565 ;;vision-display (view-vision)
566 fix-display (gen-fix-display) 566 fix-display (gen-fix-display)
567 me (sphere 0.5 :color ColorRGBA/Blue :physical? false) 567 me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
568 x-axis 568 x-axis
569 (box 1 0.01 0.01 :physical? false :color ColorRGBA/Red 569 (box 1 0.01 0.01 :physical? false :color ColorRGBA/Red
570 :position (Vector3f. 0 -5 0)) 570 :position (Vector3f. 0 -5 0))
582 "key-r" (colored-cannon-ball ColorRGBA/Red) 582 "key-r" (colored-cannon-ball ColorRGBA/Red)
583 "key-b" (colored-cannon-ball ColorRGBA/Blue) 583 "key-b" (colored-cannon-ball ColorRGBA/Blue)
584 "key-g" (colored-cannon-ball ColorRGBA/Green)) 584 "key-g" (colored-cannon-ball ColorRGBA/Green))
585 (fn [world] 585 (fn [world]
586 (light-up-everything world) 586 (light-up-everything world)
587 (speed-up world) 587 ;;(speed-up world)
588 (.setTimer world timer) 588 (.setTimer world timer)
589 (display-dilated-time world timer) 589 ;;(display-dilated-time world timer)
590 ;; add a view from the worm's perspective 590 ;; add a view from the worm's perspective
591 (if record? 591 (if record?
592 (Capture/captureVideo 592 (Capture/captureVideo
593 world 593 world
594 (File. 594 (File.
607 BufferedImage!)) 607 BufferedImage!))
608 (set-gravity world Vector3f/ZERO)) 608 (set-gravity world Vector3f/ZERO))
609 609
610 (fn [world _ ] 610 (fn [world _ ]
611 (.setLocalTranslation me (.getLocation (.getCamera world))) 611 (.setLocalTranslation me (.getLocation (.getCamera world)))
612 (vision-display 612 ;; (vision-display
613 (map #(% world) vision) 613 ;; (map #(% world) vision)
614 (if record? 614 ;; (if record?
615 (File. "/home/r/proj/cortex/render/worm-vision"))) 615 ;; (File. "/home/r/proj/cortex/render/worm-vision")))
616 (fix-display world) 616 (fix-display world)
617 ))))) 617 )))))
618 #+end_src 618 #+end_src
619 619
620 #+RESULTS: test-2 620 #+RESULTS: test-2
621 | | #'cortex.test.vision/test-worm-vision | 621 : #'cortex.test.vision/test-worm-vision
622 622
623 623
624 The world consists of the worm and a flat gray floor. I can shoot red, 624 The world consists of the worm and a flat gray floor. I can shoot red,
625 green, blue and white cannonballs at the worm. The worm is initially 625 green, blue and white cannonballs at the worm. The worm is initially
626 looking down at the floor, and there is no gravity. My perspective 626 looking down at the floor, and there is no gravity. My perspective