So I've been busy trying to come up with a way to display 3d objects in ruby using nothing but 'gosu' and lots of code.
(thus all the 3d -> 2d conversion is done manually without other libraries such as 'opengl')
An easy way to do this would be to start by drawing a 3d cube, right?
So I followed this tutorial:
http://www.skytopia.com/project/cube/cube.htmlAnd I rewrote all the code in ruby and surprisingly it worked!
Then I used draw_quad() to draw every 6 sides of the cube and I also changed the pivot-point so that
the camera could now move freely on it's own, (instead of only facing the cube) like in a first person shooter.
Now this is where I ran into a problem, because whenever I move the camera close to the cube, while facing away from the cube,
the side you are closest to would appear in front of the camera (even though you are outside the cube)
Here's a link to the ruby-code for those interested:
https://www.dropbox.com/s/18h0vpqsvwwcrcy/3d%20-%20Skytopia.zip?dl=0So does anyone have some knowledge about how to draw a cube or a 2d plane in a 3d space?