質問編集履歴

2

文章を修正しました。

2022/01/30 01:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -20,12 +20,11 @@
20
20
  pos.y = windowContext->getSize().y - position.y - character->pixelSize;
21
21
 
22
22
 
23
- //printf("%f\n", 1.0f - (1.0f - (pos.y * screenSize.y)));
23
+ //printf("%f\n", (pos.x * screenSize.x) + ((float)screenSize.x / 2.0f));
24
- printf("%f\n",((pos.x * screenSize.x) - 1.0f));
24
+ printf("%f\n",(pos.y * screenSize.y) - ((float)screenSize.y / 2.0f));
25
25
  //////////////////////////////////////////////////////////////////////////////
26
- float xpos = ((pos.x * screenSize.x) - 1.0f);
26
+ float xpos = (pos.x * screenSize.x) + ((float)screenSize.x / 2.0f);
27
-
28
- float ypos = 1.0f - (1.0f - (pos.y * screenSize.y));
27
+ float ypos = (pos.y * screenSize.y) - ((float)screenSize.y / 2.0f);
29
28
  //////////////////////////////////////////////////////////////////////////////
30
29
 
31
30
 

1

2022/01/30 01:21

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- 画面の左上を(0,0)する座標変換のアルゴリズムが知りたいです
1
+ 画面の左上を(0,0)する座標変換する方法が知りたい。
test CHANGED
File without changes