我想要的是]]
我正在使用方向传感器来获取方位角值(角度)。我也从用户出发,画了一个圆。现在,我要考虑到一步等于30个像素,在用户前往的位置绘制下一个像素。
当用户开始行走时,我想在屏幕上插入的平面图图像上绘制用户当前位置的圆圈。由于某些原因,我无法将GPS用于此解决方案。
以下是我正在执行的步骤:
到目前为止我们已经取得的成就:我们只需在当前像素上加上或减去像素,就可以在4个角度(即0、90、180和270)上绘制直线。]
newAzimuth是用户方向的当前角度
if (newAzimuth >= 45 && newAzimuth <= 135) { startX = startX + oneStepPixelsWidth; mScreenRotationTextView.setText("You turned (Right)"); } else if (newAzimuth > 135 && newAzimuth <= 225) { mScreenRotationTextVniew.setText("You turned (Back)"); startY = startY + oneStepPixelsHeight; } else if (newAzimuth > 225 && newAzimuth <= 315) { mScreenRotationTextView.setText("You turned (Left)"); startX = startX - oneStepPixelsWidth; } else if (newAzimuth > 315 || newAzimuth < 45) { mScreenRotationTextView.setText("You turned (Front)"); startY = startY - oneStepPixelsHeight; }
我想要的是:我正在使用方向传感器来获取方位角值(角度)。我也从用户出发,画了一个圆。现在我想在用户所在的位置上绘制下一个像素...