Show us Three Dimensions
Yet another 3D rendering engine, only I took the time to convert it into a library and include a rotatable camera.
Controls (Demo only, define your own if you use the library):
Code: Select all
uparrow = move camera up (+Y)
downarrow = move camera down (-Y)
leftarrow = move camera left (-X)
rightarrow = move camera right (+X)
comma = move camera backwards (-Z)
full stop/period = move camera forwards (+Z)
minus = decrease FOV
plus = increase FOV
mouse = rotate camera
n and m = change pitch
escape = close
Code: Select all
Rotatable Camera
Movable Camera
Vertex Sorting
Only one -z coordinate related graphical errors (that Ive seen)
Vector manipulation
Code: Select all
+Back face culling support (Just need to make a function to sort faces anti clockwise)
*Vertices need to be triangles (Done)
*FOV in degrees, not arbitary distance (Done)
*Mouse Hidden in Demo (Done)
+Proper rendering off offscreen points (Working on)
-Bug involving floor rendering weirdly (Will be fixed with offscreen point problem)
+More vector functions (Done, more will be added if neccessary)
+Better performance
Code: Select all
+ Added STD.renderList(object1,object2,etc)
+ Added Pitch control in demo
+ Added vectors.lua
+STDV.newVector(x,y,z) => vector
+vector:add(vector) => new vector
+vector:subtract(vector) => new vector
+vector:scale(originVector, scale) => scaled vector
+vector:magnitude() => magnitude
+vector:rotateAround(originVector,directionVector) => rotated vector (direction Vector is a normal vector but with angles in x,y,z)
+Added STD.showBorders
+Added ability to define faces with a colour
+Added ability to define faces with vectors (doesn't replace number version)
*Made render.lua use vectors.lua (self requires)
*Began fixing rendering bug spotted by Roland whee the ground renders weirdly
*Updated demo to show an array of cubes rather than 1
*Updated demo to show coloured faces (all bottom faces are black)