3D Game From Scratch

3D Game From Scratch

9 devlogs
27h 9m
Created by YM

I will be creating a 3D Math and hopefully physics Engine in which I will attempt to make as realistic of a game as possible. At the moment I am not sure as to what game I will make, but I have considered Minecraft.

Timeline

Ship 1

YM

3 months ago

YM Covers 9 devlogs and 27h 9m
YM
YM
4h 39m 3 months ago

Implemented a basic camera and clipping function

YM
YM
2h 37m 3 months ago

I was having problems with clipping and could not figure it out for many days, so I finally decided that I would search YouTube. Resources: Javid9x had a video on clipping and the mountains.obj. I also plan to use his camera since mine is too slow. You can find the copied sections in massive commented code blocks. Note: the current camera used in the video is mine.

YM
YM
2h 46m 3 months ago

Refactored my rendering methods and added some optimizations as well as a means to render .obj files. On the other hand, I have yet to add a means of sorting the triangles so that they can be seen in the appropriate manner (it is currently drawn randomly).

YM
YM
1h 54m 3 months ago

Implemented an artificial Triangle Clipping by considering whether or not the centroid and half points of the triangle are within the normalized screen or not. Now we cannot see behind the camera and the triangles don't go insane when the camera approaches it.

YM
YM
1h 36m 3 months ago

Implemented a basic light system by calculating the dot product of the triangle normal to the light source and assigning an albedo value to each set of albedo values to act as a multiplier on the RGB value, hence, darkening the color.

QuantumRohan QuantumRohan 3 months ago

It looks great, reminds me of older Minecraft shading.

YM
YM
7h 1m 3 months ago

I attempted to implement clipping so that my triangles didn't misbehave when approached, however, I was unsuccessful in my task. Instead, I decided to put clipping on a pause, and implement a stationary type camera as seen in the video. I even added features to encase the entire screen of the player as well as button functionality.

YM
YM
1h 16m 3 months ago

Used the Cross and Dot Product to figure out which triangles should be displayed and which ones should not. The cross and dot product took a while because I have never done them before, however, organic chemistry was a great resource.

YM YM 3 months ago

No, just using the default java awt and swing libraries

QuantumRohan QuantumRohan 3 months ago

Is there a library for Java that you are using?

YM
YM
2h 58m 3 months ago

My Vector-Matrix multiplying method wasn't working because I forgot to divide by w (xyzw matrix), but now everything is working fine and I even added rotation.

YM
YM
2h 18m 3 months ago

I created a sleep methodological game loop and spent lots of time attempting to derive the projection matrix as shown in the image. Now I need to create a method for actually rendering the points/triangles onto the screen as well as many other things. I'm still very far away from being anywhere near finished but overall happy with my progress so far! :)

Update attachment