idk
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
// Approximate radius of the Earth, in kilometers
|
// Approximate radius of the Earth, in kilometers
|
||||||
#define EARTH_RADIUS 6371*1000
|
#define EARTH_RADIUS 6371*1000
|
||||||
|
#define SCALE_FACTOR 100.0f
|
||||||
|
|
||||||
void compute_decimal_coords(struct IGC_DataPoint* dp)
|
void compute_decimal_coords(struct IGC_DataPoint* dp)
|
||||||
{
|
{
|
||||||
@@ -64,7 +65,8 @@ void compute_world_coords(struct IGC_DataPoint* first, struct IGC_DataPoint* dp)
|
|||||||
double z = dp->gps_alt;
|
double z = dp->gps_alt;
|
||||||
|
|
||||||
// Compute current datapoint world coords as offset from base point
|
// Compute current datapoint world coords as offset from base point
|
||||||
Vector3 current = {x-base_x, y-base_y, z-base_z};
|
//Vector3 current = {(x-base_x)/SCALE_FACTOR, (y-base_y)/SCALE_FACTOR, (z-base_z)/SCALE_FACTOR};
|
||||||
|
Vector3 current = {(x-base_x)/SCALE_FACTOR, (z-base_z)/SCALE_FACTOR, (y-base_y)/SCALE_FACTOR};
|
||||||
dp->w_coords = current;
|
dp->w_coords = current;
|
||||||
printf("DEBUG: dp->w_coords = {x=%lf, y=%lf, z=%lf}; dp->meters = {lon=%lf, lat=%lf, gps_alt=%d\n", dp->w_coords.x, dp->w_coords.y, dp->w_coords.z, dp->lon.meters, dp->lat.meters, dp->gps_alt);
|
printf("DEBUG: dp->w_coords = {x=%lf, y=%lf, z=%lf}; dp->meters = {lon=%lf, lat=%lf, gps_alt=%d\n", dp->w_coords.x, dp->w_coords.y, dp->w_coords.z, dp->lon.meters, dp->lat.meters, dp->gps_alt);
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
void start_graphics(struct dp_node* list)
|
void start_graphics(struct dp_node* list)
|
||||||
{
|
{
|
||||||
SetTraceLogLevel(4);
|
SetTraceLogLevel(4);
|
||||||
const int screenWidth = 800;
|
const int screenWidth = 1920;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 1080;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "camera");
|
InitWindow(screenWidth, screenHeight, "camera");
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ void start_graphics(struct dp_node* list)
|
|||||||
camera.projection = CAMERA_PERSPECTIVE;
|
camera.projection = CAMERA_PERSPECTIVE;
|
||||||
|
|
||||||
Vector3 cubePosition = {0.0f, 0.0f, 0.0f};
|
Vector3 cubePosition = {0.0f, 0.0f, 0.0f};
|
||||||
|
Vector3 previous = {0.0f, 0.0f, 0.0f};
|
||||||
DisableCursor();
|
DisableCursor();
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
|
|
||||||
@@ -42,8 +43,17 @@ void start_graphics(struct dp_node* list)
|
|||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
BeginMode3D(camera);
|
BeginMode3D(camera);
|
||||||
|
|
||||||
|
// Bypass HEAD
|
||||||
|
struct dp_node* current = list->next;
|
||||||
|
while (current != NULL)
|
||||||
|
{
|
||||||
|
cubePosition = current->data->w_coords;
|
||||||
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
|
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
|
||||||
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
|
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
|
||||||
|
DrawLine3D(previous, cubePosition, BLUE);
|
||||||
|
previous = cubePosition;
|
||||||
|
current = current->next;
|
||||||
|
}
|
||||||
|
|
||||||
DrawGrid(1000, 1.0f);
|
DrawGrid(1000, 1.0f);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user