Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasherpete committed Oct 31, 2023
1 parent 2ee1c10 commit e638039
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 25 deletions.
18 changes: 17 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# readme
# Overview

This is just a simple algorithm for the TI-84+ CE to render simple voxels quickly and dynamically. For now it is just an engine/algorithm, but once it is in a ready stage, it will be used to make a couple games.

![gif](https://cdn.discordapp.com/attachments/1168344250908418078/1168599163961868358/screen.gif) ![image](https://cdn.discordapp.com/attachments/772599413247442948/1168328775025561660/wireframe1.png)
### TODO

- [ ] Add common voxel coordinate lookup table to optimize rendering
- [ ] Add functionality to render planes and polygons
- [ ] Darken colors for the further away from the camera it is (volumetric fog)
- [ ] Optimize algorithm (sacrifice of accuracy is acceptable, and may make the scene loop less calculated and and definitive - more natural)
- [ ] Find a way to render everything unclipped (will need help!!)
- [ ] Render screen coordinates using 8 bit values instead of 16 - will allow the right side of the screen to be used for stats

### Changelog

***v0.1.0*** - First demo
41 changes: 17 additions & 24 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
#define RENDER_DISTANCE_ALGORITHM (z > -RENDER_DIST_Z_BACK) && (z < RENDER_DIST_Z_FRONT) && (x < RENDER_DIST_X) && (x > -RENDER_DIST_X) && (y < RENDER_DIST_Y) && (y > -RENDER_DIST_Y)


struct Player
{
int_fast8_t x;
int_fast8_t y;
int_fast8_t z;
};


void drawBox(int x, int y, int z) {

Expand Down Expand Up @@ -71,11 +64,11 @@ int main(void)
gfx_Begin();
gfx_ZeroScreen();

struct Player player;

int_fast8_t player_x = 0;
int_fast8_t player_y = 0;
int_fast8_t player_z = 0;

player.x = 0;
player.y = 0;
player.z = 0;

gfx_SetColor(gfx_red);
gfx_SetTextFGColor(gfx_red);
Expand All @@ -87,17 +80,17 @@ int main(void)
while (!(kb_Data[6] == kb_Clear)) {

if (kb_Data[7] == kb_Up) {
player.z += 1;
player_z += 1;
} else if (kb_Data[7] == kb_Down) {
player.z -= 1;
player_z -= 1;
} else if (kb_Data[7] == kb_Left) {
player.x -= 1;
player_x -= 1;
} else if (kb_Data[7] == kb_Right) {
player.x += 1;
player_x += 1;
} else if (kb_Data[1] == kb_2nd) {
player.y += 1;
player_y += 1;
} else if (kb_Data[2] == kb_Alpha) {
player.y -= 1;
player_y -= 1;
}

gfx_SwapDraw();
Expand All @@ -106,13 +99,13 @@ int main(void)
gfx_SetTextXY(5,5);
gfx_PrintInt(fps, 2);

drawBox(2-player.x,2+player.y,1-player.z);
drawBox(1-player.x,2+player.y,1-player.z);
drawBox(0-player.x,2+player.y,1-player.z);
drawBox(0-player.x,2+player.y,2-player.z);
drawBox(2-player.x,3+player.y,1-player.z);
drawBox(2-player.x,1+player.y,1-player.z);
drawBox(2-player.x,0+player.y,1-player.z);
drawBox(2-player_x,2+player_y,1-player_z);
drawBox(1-player_x,2+player_y,1-player_z);
drawBox(0-player_x,2+player_y,1-player_z);
drawBox(0-player_x,2+player_y,2-player_z);
drawBox(2-player_x,3+player_y,1-player_z);
drawBox(2-player_x,1+player_y,1-player_z);
drawBox(2-player_x,0+player_y,1-player_z);


frame_count++;
Expand Down

0 comments on commit e638039

Please sign in to comment.