Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amir-kedis/c-3dcube

3D cube rotating in 3D in C lang made as a from of escapism of my final exams
https://github.com/amir-kedis/c-3dcube

Last synced: 4 days ago
JSON representation

3D cube rotating in 3D in C lang made as a from of escapism of my final exams

Awesome Lists containing this project

README

        

# 3D cube rotating in space written in C with raylib

> [!IMPORTANT]
> This project and other similar ones are made as a form of escapism from my final exams in college **Series now includes: Conway game of life, 3D cube**

### first try
https://github.com/amir-kedis/C-3dCube/assets/88613195/712bb6a3-8217-4692-8524-5a219ebec97e

- here I tried to control the object's rotation by changing the Carizian coordinates which didn't give me the results I wanted for rotation.

### second try
https://github.com/amir-kedis/C-3dCube/assets/88613195/2a312801-45dc-4a2f-bb76-9bb8c01c8f2c

- after that, I made a coordinate transformation using spherical coordination, which worked better.
- ![image](https://github.com/amir-kedis/C-3dCube/assets/88613195/0055dfea-65f0-42c2-9fb6-e3e74e64f70c)

## Controls

- `D` and `A` -> change theta -> rotate around the y-axis (left-right)
- `W` and `S` -> change phi -> rotate around the x-axis (up-down)
- `Q` and `E` -> change r -> change the magnitude (zoom)