if i do this on line 58 of triangle.lua:
Code: Select all
return {3, triangle_out, triangle_out2 }
this is the result: if is switch them around:
Code: Select all
return {3, triangle_out2, triangle_out }
Code: Select all
clippedTris = {}
local result = Triangle.clipAgainstPlane({x = 0, y = 0, z = 0.01}, {x = 0, y = 0, z = 1}, triViewed)
if result[1] == 1 then table.insert(clippedTris, triViewed) end
if result[1] == 2 then table.insert(clippedTris, result[2]) end
if result[1] == 3 then clippedTris[#clippedTris+1] = result[2] clippedTris[#clippedTris+1] = result[3] end
Just to make it clear im using post this as my last resort, ive checked my code against the tutorial and github and even ports to other languages of the engine.
https://github.com/OneLoneCoder/Javidx9 ... 3.cpp#L310