TheOddByte, on 03 January 2016 - 05:37 PM, said:
It's so damn smooth, I remember when nitro first introduced his raycasting method and I thought that was cool, now it feels like nothing compared to this.
I'm interested, how did you create the objects for this? And you should create a program that lets you create 3D objects and sprites, so that people can use that to create 3D games
Thanks for the kind words! Although, nitro's renderer was also using scanline, not raycasting, unless you're talking about something else he made. I created the first scene using a matrix transformation stack, similar to what you might do in OpenGL. Here's the code that drives the first demo.
local function renderScene()
camera.update(keyboard)
clearDepthBuffer()
clearFrameBuffer(m_renderTarget, vec4(0, 0, 0, 1))
rotCounter = rotCounter + 0.05
pushMatrix(camera.getViewProjection())
pushMatrix(Mat4().initRotation3(0, rotCounter, 0))
pushMatrix(Mat4().initTranslation(0, 0, 0))
drawCube(t1, t2, t3, t4, cubeTexture)
popMatrix()
for i = 1, 3 do
pushMatrix(Mat4().initTranslation(2.5 * i, 0, 0))
drawCube(t1, t2, t3, t4, cubeTexture)
popMatrix()
pushMatrix(Mat4().initTranslation(-2.5 * i, 0, 0))
drawCube(t1, t2, t3, t4, cubeTexture)
popMatrix()
end
popMatrix()
pushMatrix(Mat4().initTranslation(0, -5, 0))
pushMatrix(Mat4().initScale(10, 0.5, 10))
drawCube(t1, t2, t3, t4, floorTexture)
popMatrix()
popMatrix()
popMatrix()
end