module PositionMaps ( getWCoordPos ,postionToVector ,postionToVectorInt )where import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import States import VectorMaps posCoordChange :: DState -> Position -> Position posCoordChange dst (Position x y) = (Position (x - ((windowWidth dst) `quot` 2)) (((windowHeight dst) `quot` 2) - y)) -----Positionのポジションべクトルを得る getWCoordPos :: DState -> Position -> (Vector2 GLfloat) getWCoordPos dst pos = vectorScalarElements ((2 / (fromIntegral (windowWidth dst))) :: GLfloat , (2 / (fromIntegral (windowHeight dst)))) (postionToVector (posCoordChange dst pos)) -------ポジションからベクトルへの変換 postionToVector :: Position -> (Vector2 GLfloat) postionToVector (Position x y ) = (Vector2 (fromIntegral x) (fromIntegral y)) postionToVectorInt :: Position -> (Vector2 GLint) postionToVectorInt (Position x y ) = (Vector2 x y)