; 頂点座標 vertices_x = -30, 30, 30, -30 vertices_y = 30, 30, -30, -30 ; エンティティ座標 entity_x = 200 entity_y = 100 ; 角度(°) degree = 0.0 *main radian = deg2rad(degree) redraw 0 color 0, 0, 0 boxf color 0, 255, 0 repeat ( length(vertices_x) | length(vertices_y) ) ; X vertex = vertices_x(cnt) x = ( entity_x + vertex ) x += (( cos(0) * cos(radian) - sin(0) * sin(radian) ) * absf(vertex) ) ; Y vertex = vertices_y(cnt) y = ( entity_y + vertex ) y += (( sin(0) * cos(radian) + cos(0) * sin(radian) ) * absf(vertex) ) ; 頂点描画 circle ( x - 5 ), ( y - 5 ), ( x + 5 ), ( y + 5 ), 1 loop ; 中心 color 255, 0, 0 circle ( entity_x - 5 ), ( entity_y - 5 ), ( entity_x + 5 ), ( entity_y + 5 ) redraw 1 ; 回転 degree += 2.5 degree \= 360 await 16 goto *main
エンティティの中心を支点で頂点を回転させるスクリプトを作っています。
上記のスクリプトでは加法定理を使って回転を行っていますが、
上手く動作しませんでした。どこが間違っているのか と 解決策 を教えてほしいです。
よろしくお願いします。