Skip to content

Instantly share code, notes, and snippets.

@garaemon
Created August 9, 2015 10:21
Show Gist options
  • Select an option

  • Save garaemon/e9df0c70221ee3485602 to your computer and use it in GitHub Desktop.

Select an option

Save garaemon/e9df0c70221ee3485602 to your computer and use it in GitHub Desktop.
Footstep projection
(make-irtviewer :draw-origin nil)
(setq *a* (make-cube 240 150 2))
(setq *b* (make-cube 240 150 2))
(setq *plane* (make-cube 300 200 1))
(send *b* :locate (float-vector 0 0 150) :world)
(send *b* :rotate (deg2rad 20) :y)
(setf (get *plane* :face-color) :green)
(gl::transparent *plane* 0.2)
(send *plane* :newcoords (send *b* :copy-worldcoords))
(setf (get *a* :face-color) :yellow)
(setf (get *b* :face-color) :yellow)
(send *irtviewer* :change-background (gl::find-color :white))
(objects (list *a* *b* *plane*))
;; Draw axis
(defun draw-axis-line (c &optional (length 100))
(let ((center (send c :worldpos)))
(let ((x (send c :transform-vector (scale length (float-vector 1 0 0))))
(y (send c :transform-vector (scale length (float-vector 0 1 0))))
(z (send c :transform-vector (scale length (float-vector 0 0 1)))))
(let* ((vv (send *irtviewer* :viewer))
(vs (send vv :viewsurface)))
(send vs :color (float-vector 1 0 0))
(send vv :draw-line center x)
(send vs :color (float-vector 0 1 0))
(send vv :draw-line center y)
(send vs :color (float-vector 0 0 1))
(send vv :draw-line center z)
(send vv :flush)
))))
(draw-axis-line *a*)
(draw-axis-line *b*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment