
Hello to all I want to do View Frustum Culling using Octrees, and everything is working except for one small detail: I cannot find a way to access the Projection Matrix, nor the Modelview matrix, which are taken for granted in the C/C++ versions of the library. Am I missing something? I can of course calculate the clipping planes using lookat information and the arguments to the frustum function, but cannot believe there isn't a more elegant solution... ;-) Thanks in advance, Guilherme Lopes.

Hi, Has anyone converted any texturing sample to the ghc-openGL API? There isn't any sample in the source code of ghc and it seems that some functions do not appear in the new API. Is there anywhere a minimal texture sample where I can have a look at? Cheers Patrick

Guilherme Lopes wrote:
I want to do View Frustum Culling using Octrees, and everything is working except for one small detail: I cannot find a way to access the Projection Matrix, nor the Modelview matrix, which are taken for granted in the C/C++ versions of the library. Am I missing something? I can of course calculate the clipping planes using lookat information and the arguments to the frustum function, but cannot believe there isn't a more elegant solution... ;-)
Sorry for replying so slowly, but a HW/SW upgrade kept me busy the last weeks. If you are using the OpenGL package coming with GHC 6.2(.2), you can access the current matrix via, well, "currentMatrix": :-) currentMatrix :: (Matrix m, MatrixComponent c) => StateVar (m c) i.e. currentMatrix $= blah foo <- get currentMatrix Perhaps you have to set the matrix mode via "matrixMode" before/after doing that. This is not very elegant, so "currentMatrix" has been deprecated starting with the OpenGL package shipping with the soon-to-be-released GHC 6.4. The new "official" and more general way is: matrix :: (Matrix m, MatrixComponent c) => Maybe MatrixMode -> StateVar (m c) where "matrix Nothing" is the same as "currentMatrix". In your example you can use: pm <- get (matrix Projection) mvm <- get (matrix (Modelview 0)) I really have to continue writing documentation... *sigh* Hope that helps, S.
participants (3)
-
Guilherme Lopes
-
Patrick Scheibe
-
Sven Panne