glTranslatef - part-cw/lambdanative GitHub Wiki
(glTranslatef x y z)
glTranslatef produces a translation by (x,y,z).
Parameter | Description |
---|---|
x | x shifting amount |
y | y shifting amount |
z | z shitfing amount |
Example
Example from modules/ln_glgui/glgui.scm
(define (glgui-render g1 . gx)
(glCoreInit) ;; setup the OpenGL pipeline
(glPushMatrix)
(cond
((fx= glgui:rotate 1)
(glRotatef -90. 0. 0. 1.)
(glTranslatef (flo (- app:height)) 0. 0.))
((fx= glgui:rotate 2)
(glRotatef 90. 0. 0. 1.)
(glTranslatef 0. (flo (- app:width)) 0.))
((fx= glgui:rotate 3)
(glRotatef 180. 0. 0. 1.)
(glTranslatef (flo (- app:width)) (flo (- app:height)) 0.))
)
(apply glgui-renderloop (append (list g1) gx))
(glPopMatrix)
)