GithubHelp home page GithubHelp logo

fdf's Introduction

FdF

École 42 assignment in C - 3D points and lines plotting

About this project

  • This is a solo project of École 42
  • FdF stands for "Fils de Fer" in French or wireframe in English.
  • The objective is to take the map and plot its points and lines in at least 2 types of 3D projection.
  • In this project, I set a default projection to isometric projection and if you rotate it, you will get parallel projection.

thailand

The map

  • The map contain a list of coordinates.
  • The horizontal position corresponds to its axis.
  • The vertical position corresponds to its ordinate.
  • The value corresponds to its altitude.

map

How to run the program

  • (I use MinilibX from the school system and don't have the library in this repo.)
  • Run Makefile to create executable "fdf"
     make
    
  • Usage
     ./fdf [map]
    
  • I included some sample maps in the folder "maps". To run it.
     ./fdf maps/42.fdf
    

42

Bonus

  • The color goes from blue to green according to the magnitude.
  • X-axis rotation with key 5 and 8.
  • Y-axis rotation with key 4 and 6.
  • Z-axis rotation with key 7 and 9.
  • Adjust height level with key 2 and 3.
  • Zoom in and out with key + and -.
  • Move the map with arrow keys.
  • The object is default to the center of the viewpoint.
  • Also using image instead of pixel in MiniLibX to gain more performance (if you count it as a bonus.)

The algorithm I used

  • I used Bresenham's line algorithm for line plotting.
  • I used basic trigonometry in 3D rotation.

fdf's People

Contributors

terngkub avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.