Uncategorized – Fatih Cil https://www.fatihcil.com Mon, 26 Jun 2023 13:55:45 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 https://www.fatihcil.com/wp-content/uploads/2023/01/cropped-fatihsiteicon2-32x32.png Uncategorized – Fatih Cil https://www.fatihcil.com 32 32 Cub3d https://www.fatihcil.com/cub3d/ https://www.fatihcil.com/cub3d/#respond Fri, 30 Sep 2022 09:48:00 +0000 https://www.fatihcil.com/?p=574

Introduction:

You can access to project codes on Github

The Cub3D project is a 3D game project that is part of the curriculum for the 42 coding school. It’s
 inspired by the classic first-person shooter game Wolfenstein 3D, is an excellent way to learn and practice computer graphics programming, specifically ray-casting. In this blog post, we will provide a step-by-step guide on how to develop your own cub3D project using the C programming language and the miniLibX library.

You can access the project topic here

Step 1: Setting Up Your Environment

First, ensure you have a compatible development environment.
You will need:

  • A C compiler, such as GCC
  • The miniLibX library, which can be downloaded from the 42 school’s website
Step 2: Understanding the Basics of Ray-Casting

Ray-casting is a technique used to create a 3D perspective in a 2D environment. It involves casting rays from the player’s position to the walls and calculating the distance to them. The distance to the walls is then used to determine their height on the screen. Familiarize yourself with this concept before proceeding.

Step 3: Creating the Game Loop

Start by setting up a game loop that will handle rendering and user input. The loop should consist of the following steps:

  • Handle user input (e.g., moving forward, backward, turning left or right)
  • Update the player’s position and direction
  • Clear the screen
  • Perform ray-casting to render the scene
  • Update the screen with the rendered scene
Step 4: Handling User Input

Using the miniLibX library, set up event-driven programming to handle keyboard input for player movement and interaction. Typical key bindings include W, A, S, and D for forward, left, back, and right movements, and arrow keys for rotating the view.

Step 5: Implementing Ray-Casting

Implement the ray-casting algorithm by following these steps:
Calculate the initial ray direction for each vertical column on the screen.

  • Determine which grid cell the ray intersects first.
  • Traverse the grid cells using DDA (Digital Differential Analysis) algorithm until a wall is hit.
  • Calculate the distance from the player to the wall.
  • Determine the wall height on the screen based on this distance.
Step 6: Adding Textures and Sprites

To enhance the visual appeal of your cub3D project, apply textures to the walls and add sprites for objects and enemies. Load textures using miniLibX and map them to the walls during the ray-casting process. For sprites, calculate their position relative to the player, sort them by distance, and render them on the screen.

Conclusion:

Developing the Cub3D project is a great way to learn about game development and graphics programming. By following these steps, you can create a basic 3D game engine that is capable of rendering textured walls, sprites, and a simple game world. While the project may seem challenging at first, with some patience and dedication, you can develop a functional game engine that you can be proud of.

]]>
https://www.fatihcil.com/cub3d/feed/ 0
Fractals: A Journey with Fract-ol https://www.fatihcil.com/fractals-a-journey-with-fract-ol/ https://www.fatihcil.com/fractals-a-journey-with-fract-ol/#respond Mon, 30 May 2022 13:31:00 +0000 https://www.fatihcil.com/?p=660

Introduction

You can access the code on Github

  Welcome to my blog! In this post, I want to share my experience developing the Fract-ol project during my time at École 42. Fract-ol is an exciting and visually stunning project that allowed me to dive deep into the world of fractals using the power of C programming language and the Minilibx library.

Understanding Fractals

  Fractals are fascinating mathematical structures that exhibit self-similarity at different scales. They are created through a process called iteration, where a mathematical formula is repeatedly applied to generate intricate and complex patterns. Fractals can be found in nature, architecture, and art, and exploring them can be a captivating and enlightening experience.

Setting The Foundation

  To embark on this project, I began by studying the fundamentals of fractals, their equations, and the algorithms used to render them. It was crucial to gain a solid understanding of concepts like the Mandelbrot set and the Julia set, as they are the building blocks of our project. Additionally, I familiarized myself with the C programming language and the Minilibx library, which provides a primary graphic user interface for rendering images.

Creating The UI

   The first step was to develop a user interface that would allow users to interact with the fractals. I utilized the Minilibx library to create a window where users could explore and navigate the fractal space. I implemented keyboard and mouse input handlers to enable zooming, panning, and adjusting parameters such as color schemes and iterations.

Rendering The Fractals

   To render the fractals, I implemented various algorithms, such as the Escape Time Algorithm and the Continuous Potential Algorithm. These algorithms iterate over each pixel in the display window and calculate the corresponding fractal value based on its coordinates. This value is then used to determine the color of the pixel, creating the intricate patterns that define fractals.

Implementing Zoom And Navigation

   One of the most exciting aspects of Fract-ol is the ability to zoom into the fractal space and explore the intricate details. I implemented zoom functionality by allowing users to click and drag a specific area of interest. This process involved recalculating the coordinates and iterations for the new zoomed-in area, providing a seamless and immersive experience.

Conclusion

   Developing the Fract-ol project was an exhilarating journey that allowed me to explore the fascinating world of fractals while sharpening my programming skills. It provided a unique blend of mathematical concepts, graphical programming, and user interaction, resulting in a visually stunning and immersive experience. Through this project, I gained a deeper appreciation for the beauty and complexity of fractals and learned how to translate mathematical concepts into captivating visuals. As a result, I implemented the algorithms of Mendelbrot, Julia and Multibrot fractals into my project and got to know that magical world closely 🙂

]]>
https://www.fatihcil.com/fractals-a-journey-with-fract-ol/feed/ 0
42 Piscine: A Challenging But Rewarding Experience https://www.fatihcil.com/42-piscine-a-challenging-but-rewarding-experience/ https://www.fatihcil.com/42-piscine-a-challenging-but-rewarding-experience/#respond Fri, 07 Jan 2022 19:43:00 +0000 https://www.fatihcil.com/?p=510

Hey guys, have you ever heard of 42 piscine? Basically, it’s a four-week programming Bootcamp from hell that serves as the admissions process to the 42 École programming schools.

Piscine is designed to test your coding skills, your ability to collaborate with others, and your general sanity. You are given a series of programming challenges and projects to complete with very little guidance or instruction. And you are expected to do it all in a limited time.

But despite all the craziness, it was an enriching experience. Of course, I learned a lot about coding, but I also learned a lot about myself. I discovered I had much more courage and determination than I thought possible. I also learned how to communicate effectively with others and how to work in a team. And let’s remember the invaluable skill of surviving on very little sleep!

One of the best things about Piscine was the community. I’ve met many great people who are just as passionate about coding as I am. We all supported and helped each other. It was a great environment to be a part of, and I made some great friends along the way.

In the end, I successfully completed the piscine and was invited to continue my studies at 42 École. It was a proud moment for me, and I felt grateful for the experience that I had gone through. The piscine had tested me in ways I never thought possible, and I emerged more assertive and more determined.

In conclusion, the 42 piscine is an incredible opportunity for anyone passionate about coding. It is a challenging and demanding experience, but it is also gratifying. Suppose you are willing to work hard and persevere. In that case, you will gain invaluable skills and knowledge that will serve you well in your future career as a programmer. If you are up for the challenge, I highly recommend that you give the 42 piscine a try!

]]>
https://www.fatihcil.com/42-piscine-a-challenging-but-rewarding-experience/feed/ 0
Beginning of the Road! https://www.fatihcil.com/hello-world/ https://www.fatihcil.com/hello-world/#comments Mon, 15 Jun 2020 00:17:00 +0000 https://www.fatihcil.com/?p=1

Welcome to my blog! Here, I will be sharing my projects and general ideas on a variety of topics. From programming to philosophy, I have a range of interests that I can’t wait to explore with you. This blog is a space where I can express myself and share my knowledge with others. I hope you’ll join me on this journey of creativity and discovery

 

]]>
https://www.fatihcil.com/hello-world/feed/ 1