Hello everyone!
Last days I tried to make 3D rendering ower 2D. Yes, there no hight performance, as for me that was small experiment for experience.
Simple render system, simple entity system ( models ). Any way that was my first experience with love 2d and with custom 3d rendering.
I think there is a little error in the transformations you are doing, probably a sine or cosine. If you try to look at the bottom of the crate it looks more like a rhombus than a square.
As I said in the top this is awesome and really well done... Too bad meshes dont warp the images the right way!! you could be doing a lot of things...
for i, person inipairs(everybody) do [tab]ifnot person.obey then person:setObey(true) end end
love.system.openURL(github.com/pablomayobre)
raingloom wrote:When I move the camera closer, there is a really noticeable transformation error. Otherwise it's not bad.
That is probably caused by meshes trying to transform the image in a 2D plane instead of a 3D one, can only be fixed with shaders but would destroy the whole point of doing all this in software I think
for i, person inipairs(everybody) do [tab]ifnot person.obey then person:setObey(true) end end
love.system.openURL(github.com/pablomayobre)
raingloom wrote:When I move the camera closer, there is a really noticeable transformation error. Otherwise it's not bad.
That is probably caused by meshes trying to transform the image in a 2D plane instead of a 3D one, can only be fixed with shaders but would destroy the whole point of doing all this in software I think
I would still recommend a shader. Löve's built-in meshes don't correct for perspective so you get the warping. The shader is the best way to do it without it being built into Löve itself.
Note: I've highly modified my version of the Perspective.lua file since Monkey Man gave it to me, but it still works the same way. (I added the ability to tint the image a certain color like for doing darkness and fog and made it so I could use it with any size resolution I need like for drawing to canvases that are smaller or bigger than the current resolution of the window.)
Error
3Dlib.lua:159: Invalid Mesh vertex data type name '500', expected one of: 'byte', 'unorm16', 'float'
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newMesh'
3Dlib.lua:159: in function 'Render'
main.lua:104: in function 'draw'
[love "callbacks.lua"]:168: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'