comparison org/gabor.org @ 458:42ddfe406c0a

working on depth maps for the lulz.
author Robert McIntyre <rlm@mit.edu>
date Tue, 11 Jun 2013 07:13:42 -0400
parents 057d47fc4789
children
comparison
equal deleted inserted replaced
457:ee977613c244 458:42ddfe406c0a
175 175
176 (defn print-kernel [kernel] 176 (defn print-kernel [kernel]
177 (println (.dump kernel))) 177 (println (.dump kernel)))
178 178
179 179
180 (def brick-length 0.48)
181 (def brick-width 0.24)
182 (def brick-height 0.12)
183 (def gravity (Vector3f. 0 -9.81 0))
184
185
186 (defn brick* [position]
187 (println "get brick.")
188 (doto (box brick-length brick-height brick-width
189 :position position :name "brick"
190 :material "Common/MatDefs/Misc/Unshaded.j3md"
191 :texture "Textures/Terrain/BrickWall/BrickWall.jpg"
192 :mass 34)
193 (->
194 (.getMesh)
195 (.scaleTextureCoordinates (Vector2f. 1 0.5)))
196 (.setShadowMode RenderQueue$ShadowMode/CastAndReceive)
197 )
198 )
199
200
201 (defn floor*
202 "make a sturdy, unmovable physical floor"
203 []
204 (box 10 0.1 5 :name "floor" :mass 0
205 :color ColorRGBA/Gray :position (Vector3f. 0 0 0)))
206
207 (defn floor* []
208 (doto (box 10 0.1 5 :name "floor" ;10 0.1 5 ; 240 0.1 240
209 :material "Common/MatDefs/Misc/Unshaded.j3md"
210 :texture "Textures/BronzeCopper030.jpg"
211 :position (Vector3f. 0 0 0 )
212 :mass 0)
213 (->
214 (.getMesh)
215 (.scaleTextureCoordinates (Vector2f. 3 6)));64 64
216 (->
217 (.getMaterial)
218 (.getTextureParam "ColorMap")
219 (.getTextureValue)
220 (.setWrap Texture$WrapMode/Repeat))
221 (.setShadowMode RenderQueue$ShadowMode/Receive)
222 ))
223
224
225 (defn brick-wall* []
226 (let [node (Node. "brick-wall")]
227 (dorun
228 (map
229 (comp #(.attachChild node %) brick*)
230 (for [y (range 10)
231 x (range 4)
232 z (range 1)]
233 (Vector3f.
234 (+ (* 2 x brick-length)
235 (if (even? (+ y z))
236 (/ brick-length 4) (/ brick-length -4)))
237 (+ (* brick-height (inc (* 2 y))))
238 (* 2 z brick-width) ))))
239 (.setShadowMode node RenderQueue$ShadowMode/CastAndReceive)
240 node))
241
242 (import com.aurellem.capture.Capture) 180 (import com.aurellem.capture.Capture)
243 181
244 (import java.io.File) 182 (import java.io.File)
245 183
246 (def base "/home/r/proj/cortex/render/gabor-1/") 184 (def base "/home/r/proj/cortex/render/gabor-1/")