Name: Anonymous 2011-11-27 5:27
How do I convert 2d isometric sprite into a 3d model?
(define (map-to-view xy)
(let ([x (vector-ref xy 0)]
[y (vector-ref xy 1)])
(vector (- (* x (/ tile-w 2)) (* y (/ tile-w 2)))
(- (* x (/ tile-h 2)) (* y (/ tile-h 2))))))
(define (view-to-map xy)
(let ([x (vector-ref xy 0)]
[y (vector-ref xy 1)])
(vector (/ (+ (* y tile-w) (* x tile-h))
(* tile-w tile-h))
(/ (- (* y tile-w) (* x tile-h))
(* tile-w tile-h)))))