]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/4DNav/camera/camera.factor
Merge branch 'master' into experimental
[factor.git] / unmaintained / 4DNav / camera / camera.factor
1 USING: kernel namespaces math.vectors opengl 4DNav.turtle self ;
2
3 IN: 4DNav.camera
4
5 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6
7 : camera-eye ( -- point ) turtle-pos> ;
8
9 : camera-focus ( -- point ) [ 1 step-turtle turtle-pos> ] save-self ;
10
11 : camera-up ( -- dirvec )
12 [ 90 pitch-up turtle-pos> 1 step-turtle turtle-pos> swap v- ] save-self ;
13
14 : do-look-at ( camera -- )
15 [ >self camera-eye camera-focus camera-up gl-look-at ] with-scope ;