
Hi, I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-... Should I use loadIdentity then multMatrix instead ? Thank you, Thu

On Thu, Sep 25, 2008 at 15:39, minh thu
Hi,
I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-...
Should I use loadIdentity then multMatrix instead ?
Thank you, Thu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
From what I can see in the source, loadMatrix is method of class MatrixComponent [1]: instance MatrixComponent GLfloat_ where getMatrix = getFloatv loadMatrix = glLoadMatrixf loadTransposeMatrix = glLoadTransposeMatrixfARB multMatrix_ = glMultMatrixf multTransposeMatrix = glMultTransposeMatrixfARB rotate a (Vector3 x y z) = glRotatef a x y z translate (Vector3 x y z) = glTranslatef x y z scale = glScalef However, for some reason it is not exported: MatrixOrder(..), MatrixComponent(rotate,translate,scale), Matrix(..), Best regards Christopher Skrzętnicki [1]: http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/src/Graph...

"minh thu"
I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-...
Should I use loadIdentity then multMatrix instead ?
You're supposed to use withMatrix and regard OpenGL not as an imperative language, but as a markup language coincidentally using "do" to specify (flattened) lists. I even read about some library managing display lists transparently for you, but I can't recall where. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or broadcasting of this signature prohibited.

2008/9/25 Achim Schneider
"minh thu"
wrote: I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-...
Should I use loadIdentity then multMatrix instead ?
You're supposed to use withMatrix and regard OpenGL not as an imperative language, but as a markup language coincidentally using "do" to specify (flattened) lists. I even read about some library managing display lists transparently for you, but I can't recall where.
If you're right, it's weird there are things like loadIdentity, $=, ... and it is even weirder to not provide loadMatrix (which can be done with loadIdenity and multMatrix). Anyway, the bindings are not that much functionnal, even with things like withMatrix. Cheers Thu

withMatrix doesn't seem to have anything to do with glLoadMatrix.
You are right that you can do glLoadMatrix with loadIdentity and multMatrix.
To directly load a matrix, use the function "matrix" (with a Nothing
argument). This will internally call the loadMatrix function that
Krzysztof mentioned (which is correctly not exported).
Note that in addition to loading a matrix, the "matrix" function is
also used for retrieving the current matrix. (glGetFloatv with
argument GL_MODELVIEW_MATRIX and friends).
On Thu, Sep 25, 2008 at 5:12 PM, minh thu
2008/9/25 Achim Schneider
: "minh thu"
wrote: I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-...
Should I use loadIdentity then multMatrix instead ?
You're supposed to use withMatrix and regard OpenGL not as an imperative language, but as a markup language coincidentally using "do" to specify (flattened) lists. I even read about some library managing display lists transparently for you, but I can't recall where.
If you're right, it's weird there are things like loadIdentity, $=, ... and it is even weirder to not provide loadMatrix (which can be done with loadIdenity and multMatrix).
Anyway, the bindings are not that much functionnal, even with things like withMatrix.
Cheers Thu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

2008/9/25 Bit Connor
withMatrix doesn't seem to have anything to do with glLoadMatrix.
You are right that you can do glLoadMatrix with loadIdentity and multMatrix.
To directly load a matrix, use the function "matrix" (with a Nothing argument). This will internally call the loadMatrix function that Krzysztof mentioned (which is correctly not exported).
Note that in addition to loading a matrix, the "matrix" function is also used for retrieving the current matrix. (glGetFloatv with argument GL_MODELVIEW_MATRIX and friends).
Ok, thank you, Thu

"minh thu"
Anyway, the bindings are not that much functionnal, even with things like withMatrix.
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/35444/focus=35713 Mind you: regarding 3d, I barely manage to code up camera movements. That is, I don't use it much at all. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or broadcasting of this signature prohibited.
participants (4)
-
Achim Schneider
-
Bit Connor
-
Krzysztof Skrzętnicki
-
minh thu