Pseudo 3D Explained?

Hello, Im having trouble understanding how to make a pseudo 3d engine. I also already have my own engine for making lines and doing stuff on a frame.

My code so far:

local cell_size = 1

local map = {
	{1,1,1,1,1},
	{1,0,2,0,1},
	{1,0,0,0,1},
	{1,0,1,0,1},
	{1,1,1,1,1}
}

function player_pos()
	for i=1, #map do
		for v=1, #map[i] do
			if map[i][v] == 2 then
				return {i,v}
			end
		end
	end
end
2 Likes

You can find a lot of information on youtube or wiki(i think). But in short, for each line of the screen you need to do a raycast(Since you are making a map that is not in the 3D space of Roblox, you need to do your own raycast). Next, you get the distance from the raycast (in the simplest case) then you need to color and size every line depending on this distance. Interesting idea.

Edit: I think that you do not need to put the player on the map. You can put the player’s position and rotation angle into variables and use them in calculations.

1 Like