Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ロボット ゲームの競技場を視覚化する必要があります。残念ながら、ゲームは右手座標系を使用しており、y 軸は上を指しています。
この座標系と一致するように、描画領域の cairo コンテキストを調整する方法はありますか?
スケーリング、移動、回転はできますが、すべての座標を個別に変換するよりも便利な y 軸の向きを切り替える方法が見つかりません。
ご意見ありがとうございます。
cairo_matrix_t:内のすべてのフィールドを定義できます。
cairo_matrix_t
cairo_matrix_t flip_y; cairo_matrix_init(&flip_y, 1, 0, 0, -1, 0, 0); cairo_set_matrix(cr, &flip_y);
変換がどのように適用されるかを覚えておいてください。
x_new = xx * x + xy * y + x0; y_new = yx * x + yy * y + y0;