FdF

by bhagenlo

written for version 2

Hi! Are you excited yet?

Finally, a project you can show your non-coder friends & family. It is no 2D-game and no beautiful infinite self-similar structure, but hey, it's about maps. And in 3D. (And has the coolest intro I've encountered so far.)

All joking aside, I think FdF is the most computationally interesting of the three – but I leave that up to you to decide.

Still here?
Okay. What do you need to start?

#Prerequisites

Although the project on its own could be relatively straightforward, it is quite useful to first get accustomed to the environment you're operating in. (Hint: It's different than usual.)

  1. Get to know the library of your choice: the minilibx if you like memleaks, the MLX42 if not. The former has quite a good guide made by hsmits, the latter a comprehensive official documentation.
  2. Read the documentation.
  3. Really. At least until here.
When choosing the library, make sure to check how this will be handled on your campus. On the MLX42 wiki is a nice FAQ about exactly that :)

#During

Ready? Okay. What do we need to do?

We need to:

  1. Parse the map – and extract the (3D) points from it.
  2. Project those points to 2D.
  3. Draw them, as well as the lines in between.

And that's already it. Along the lines, you'll discover isometric projection, as well as 'the' original line drawing algorithm.

Some minor remarks:

  • Drawing outside the available pixels (meaning: drawing outside of the bottom of the window) results in Segfaults. Make sure to protect against that :)
  • The image in the subject does not obey isometric projection – do it right :)
  • It is also colored – I don't know why, but since the subject does not state it, we're quite certain you don't have to implement it.

#Cleaning Up

  • Does the program always close in a clean way? (clicking 'x', typing ESC, closing the window otherwise?)
  • Make sure you don't have memory leaks – not from your own code, and not from wrong library handling :)
  • Think about the evaluation.
    Does it happen on your PC? If not, depending on which library you used, you might need to install some things to get your project up and running, right? Make sure to take preparations for that.

#Aftercare

Since you'll be doing another graphics project during the core, we don't think there is much more to say (or practice) for here. Maybe enjoy some free time, or meet some peers in the kitchen?

And with that:

See you at the next project.

And may your projections never be skewed.

#Pointers

← so_long

Found something to improve? Edit this page on Github!

fract_ol →