[問題] openGL旋轉及移動至定位
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Code Block
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
OpenGL
問題(Question):
小弟將滑鼠坐標轉換到可視範圍
glOrtho(-10.0, 10.0, -10.0, 10.0, -10.0, 10.0);
而視窗大小為500*500
餵入的資料(Input):
滑鼠點擊位置
預期的正確結果(Expected Output):
希望我點擊之後,橢圓的中心可以隨著我算出的單位向量移動至滑鼠
位置
錯誤結果(Wrong Output):
物體亂飛,無法到我滑鼠正確指定位置
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/lnlFdP8X
補充說明(Supplement):
MouseToWindow()將滑鼠坐標轉換至視窗大小及可視範圍正確比例
MoveVectot()取得移動向量
getcir()先繪製一橢圓
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.254.108.159
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1396495542.A.F56.html
→
04/03 11:37, , 1F
04/03 11:37, 1F
→
04/08 14:17, , 2F
04/08 14:17, 2F
推
04/17 09:22, , 3F
04/17 09:22, 3F
→
04/17 10:02, , 4F
04/17 10:02, 4F