本文介绍了哈斯克尔loadMatrixf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
LoadMatrixf的OpenGL函数在哪里?类型签名是什么? 解决方案
LoadMatrixf的OpenGL函数在哪里?类型签名是什么? 解决方案
请参阅。我认为你在这些文档中寻找 newMatrix
或矩阵
StateVar。
例如:让 mat
成为代表矩阵的16个浮点数列表。然后你可以像这样使用它:
将合格的Graphics.Rendering.OpenGL.GL导入为GL
drawThingWithMatrix :: [GL.GLfloat] - > IO()
drawThingWithMatrix mat = GL.preservingMatrix $ do - 而不是push / pop
newmat< - GL.newMatrix GL.RowMajor mat - 或ColumnMajor
GL.currentMatrix GL。 $ = newmat
- 画出你的东西
这就是约对,我想。已经有一段时间了。
Where is the OpenGL function for loadMatrixf and what is the type signature?
See the Matrix class. I think you are looking for either newMatrix
or the matrix
StateVar in those docs.
For example: let mat
be a list of 16 floats representing the matrix. Then you would use it something like this:
import qualified Graphics.Rendering.OpenGL.GL as GL
drawThingWithMatrix :: [GL.GLfloat] -> IO ()
drawThingWithMatrix mat = GL.preservingMatrix $ do -- instead of push/pop
newmat <- GL.newMatrix GL.RowMajor mat -- or ColumnMajor
GL.currentMatrix GL.$= newmat
-- draw your thing
That's about right I think. It has been a while.
这篇关于哈斯克尔loadMatrixf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!