Last Modified: 2024-Feb-20

date: invalid date ‘docs/DroneWorld/droneworld.mdY’

1) Introduction

Cringe motivation

The language of choice is C, because I want to try the new c23’s features, also, using OPENGL because I already know some and how much Raylib eases the development.

The main motivation, sadness 🤣.

I might make some entries about EF/C# optimizations, gotta make having read the language specification useful😀.

2) First iteration

  1. Data Road structure

Nice and simple, let’s code… AAnd this is too abstracted, the main problems is what data should the opengl thread have.

On this first iteration, I converted the json of the ways and nodes returned by the query into 2D paths.

struct node {
  u64 id;
  double lat;
  double lon;
};
struct way {
  u64 id;
  i64 nodesCount;
  struct node *nodes;
};
struct elements {
  struct node *nodes;
  struct way *ways;
  u64 nodesCount;
  u64 waysCount;
};

Then turn the 2D paths into rectangles as they are roads, which are rect with some angles and curves.😥 ~For now in the cpu, but I think I can bake something in the geometry shader.~ I haven’t read that much about geometry shaders 😄

  • Path to road

  • If we only have into consideration the next point, once the path angles a bit, there will be some weird effects, without making it too complicated or complex, making only 2 road points per path point should be enough.

  • Data structure for managing the road: For now I’m just using arrays, yep…. 10k start to hit 5 seconds Already developed but not blogged yet

Last Modified: 2024-Nov-13

  1. Minimap Similar to GTA or any other game, It needs a minimap, main requirements:
    • Show the player position/direction
    • Zoom in/out
    • Fetch real data from the internet For this first iteration I’ve done this simple algorithm, divide into grids in which the player is in the center (ala GTA) and make the minimap request for data about the grids that don’t have the data yet. Conveniently the data is stored in 2D arrays .

minimap

Litle video showing:


"... and then, all you've coded will be lost, like tears in the rain"