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