use gl-look-at, and make gl-look-at more elegant
parent
9f3baec4d2
commit
3a7faad878
|
@ -59,10 +59,10 @@ IN: jamshred.gl
|
|||
GL_LIGHT0 GL_SPECULAR F{ 1.0 1.0 1.0 1.0 } >c-float-array glLightfv ;
|
||||
|
||||
: player-view ( player -- )
|
||||
[ location>> first3 ]
|
||||
[ [ location>> ] [ forward>> ] bi v+ first3 ]
|
||||
[ up>> first3 ] tri gluLookAt ;
|
||||
[ location>> ]
|
||||
[ [ location>> ] [ forward>> ] bi v+ ]
|
||||
[ up>> ] tri gl-look-at ;
|
||||
|
||||
: draw-jamshred ( jamshred width height -- )
|
||||
init-graphics jamshred-player dup player-view draw-tunnel ;
|
||||
init-graphics jamshred-player [ player-view ] [ draw-tunnel ] bi ;
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ MACRO: set-draw-buffers ( buffers -- )
|
|||
swap glPushAttrib call glPopAttrib ; inline
|
||||
|
||||
: gl-look-at ( eye focus up -- )
|
||||
>r >r first3 r> first3 r> first3 gluLookAt ;
|
||||
[ first3 ] tri@ gluLookAt ;
|
||||
|
||||
TUPLE: sprite loc dim dim2 dlist texture ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue