(rotation-3d-example game)

Example

(play-cljc.gl.core/render game (-> entity (assoc :clear {:color [1 1 1 1], :depth 1} :viewport {:x 0, :y 0, :width game-width, :height game-height}) (play-cljc.transforms/project 0 game-width game-height 0 400 -400) (play-cljc.transforms/translate tx ty 0) (play-cljc.transforms/rotate r :x) (play-cljc.transforms/rotate r :y) (play-cljc.transforms/rotate r :z) (play-cljc.transforms/translate -50 -75 0)))

Source

(defn rotation-3d-example [game] (gl game enable (gl game CULL_FACE)) (gl game enable (gl game DEPTH_TEST)) (let [entity (f-entity game data/f-3d) tx 100 ty 100 *state (atom {:tx tx, :ty ty, :r 0})] (eu/listen-for-mouse game *state) (assoc game :entity entity :*state *state)))