Please sign in to access this page

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

0 payouts of shell 0 shells

YM

about 1 month ago

YM Covers 9 devlogs and 27h 9m

Implemented a basic camera and clipping function

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.

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).

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.

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.

It looks great, reminds me of older Minecraft shading.

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.

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 about 2 months ago
No, just using the default java awt and swing libraries
Is there a library for Java that you are using?

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.

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