[HOpenGL] Hitdetection

Patrick Scheibe mai99dnn at studserv.uni-leipzig.de
Tue Feb 22 09:29:28 EST 2005


Hi,

I wasn't able to find my problem. So I did some debug stuff. I killed ALL 
camera justification and made only one rotation and one scale.
I did the same in den display method (all stuff only on a projection matrix). 
I saw my game board from above and everything works fine.

  (_,maybeHitRecords)<- getHitRecords 128 $  withName (Name 0) $ do
			preservingMatrix $ do
			 loadIdentity
			 pickMatrix (fromIntegral winx,  fromIntegral (500-winy)) (5, 5) vp
			 rotate 90 $ Vector3 1 0 (0::GLfloat)
			 scale 0.3 0.3 (0.3::GLfloat)
			 drawBoardSelection
		        flush

So my problem is: in the display func I set the gluperspective on the 
projection matrix and the gluLookAt, board transformations, ... on the 
modelview matrix.
Isn't it wrong to make all this things on one projectionmatrix when I make the 
hitdetection?? I'm very sure that my hitrecord method has not the same view 
of my board like I have. Thats probably the reason why I have hits where I 
shouldn't have them.

In the RedBook they did it on one projection matrix and I works. The opengl 
guys really know what they do, but could it be that I have to make it a bit 
different?
I will be very gratefull for any good suggestions.

Best regards
Patrick



More information about the HOpenGL mailing list