0 Members and 2 Guests are viewing this topic.
You don't actually know if Chockosta used his code or not, so I wouldn't go and accuse him, a PM asking him about this would be more appropriate. However, if this is true, then Chockosta, you should give him credit.
double cameraX = 2 * x / double(w) - 1; //x-coordinate in camera spacedouble rayPosX = posX;double rayPosY = posY;double rayDirX = dirX + planeX * cameraX;double rayDirY = dirY + planeY * cameraX;
cameraX=(x*2/w)-1rayPosX=camera[1]rayPosY=camera[2]rayDirX=dirX+planeX*cameraXrayDirY=dirY+planeY*cameraX
int mapX = int(rayPosX);int mapY = int(rayPosY);double deltaDistX = sqrt(1 + (rayDirY * rayDirY) / (rayDirX * rayDirX));double deltaDistY = sqrt(1 + (rayDirX * rayDirX) / (rayDirY * rayDirY));
mapX=math.floor(rayPosX)mapY=math.floor(rayPosY)deltaDistX=racine(1+(rayDirY*rayDirY)/(rayDirX*rayDirX))deltaDistY=racine(1+(rayDirX*rayDirX)/(rayDirY*rayDirY))
if (rayDirX < 0) { stepX = -1; sideDistX = (rayPosX - mapX) * deltaDistX;} else { stepX = 1; sideDistX = (mapX + 1.0 - rayPosX) * deltaDistX;}if (rayDirY < 0) { stepY = -1; sideDistY = (rayPosY - mapY) * deltaDistY;} else { stepY = 1; sideDistY = (mapY + 1.0 - rayPosY) * deltaDistY;}
if rayDirX<0 then stepX=-1 sideDistX=(rayPosX-mapX)*deltaDistXelse stepX = 1; sideDistX = (mapX+1-rayPosX)*deltaDistXendif rayDirY<0 then stepY=-1; sideDistY=(rayPosY-mapY)*deltaDistYelse stepY=1; sideDistY=(mapY+1-rayPosY)*deltaDistYend
while (hit == 0) { if (sideDistX < sideDistY) { sideDistX += deltaDistX; mapX += stepX; side = 0; } else { sideDistY += deltaDistY; mapY += stepY; side = 1; } if (worldMap[mapX][mapY] > 0) hit = 1;}
while hit==0 do if sideDistX<sideDistY then sideDistX=sideDistX+deltaDistX mapX=mapX+stepX side=0 else sideDistY=sideDistY+deltaDistY mapY=mapY+stepY side=1 end if map[mapX][mapY]>0 then hit=1 endend
if (side == 0) perpWallDist = fabs((mapX - rayPosX + (1 - stepX) / 2) / rayDirX);else perpWallDist = fabs((mapY - rayPosY + (1 - stepY) / 2) / rayDirY);
if side==0 then perpWallDist=math.abs((mapX-rayPosX+(1-stepX)/2)/rayDirX)else perpWallDist=math.abs((mapY-rayPosY+(1-stepY)/2)/rayDirY)end
int lineHeight = abs(int(h / perpWallDist));int drawStart = -lineHeight / 2 + h / 2;if(drawStart < 0) drawStart = 0;int drawEnd = lineHeight / 2 + h / 2;if(drawEnd >= h) drawEnd = h - 1;
hauteurLigne=math.abs(math.floor(h/perpWallDist))drawStart=math.floor(-hauteurLigne/2+h/2)drawEnd=math.floor(hauteurLigne/2+h/2)if drawStart<0 then drawStart=0endif drawEnd>=h then drawEnd=h-1end
Hayleia I don't know what Wolfenstein has to do with all this, you clearly did not read either the content in the link nor my last message.
Ok, I should not fight but I read your link and it is written "Wolfenstein 3D" so it is you that didn't read your link before speaking. So before saying people are stupid, look at you.
If you want to keep saying people copy others, go to the ASM forums and ask why they all use bcall(ClrLCDfull)
...The programmers there aren't trying to claim that they wrote ClrLCDFull. They just call it whenever they have to use it.
Quote from: JosJuice on July 14, 2011, 08:22:27 am...The programmers there aren't trying to claim that they wrote ClrLCDFull. They just call it whenever they have to use it.But me, I wrote this raycaster. I followed a tutorial, but I wrote the entire thing.
Quote from: Deron on July 14, 2011, 06:00:31 amHayleia I don't know what Wolfenstein has to do with all this, you clearly did not read either the content in the link nor my last message.Ok, I should not fight but I read your link and it is written "Wolfenstein 3D" so it is you that didn't read your link before speaking. So before saying people are stupid, look at you. As I don't want to start a fight, I will not answer you from now.If you want to keep saying people copy others, go to the ASM forums and ask why they all use bcall(ClrLCDfull)
Sure. I totally agree. Please read my post ( http://ourl.ca/12034/227840 ) and tell me which tutorial is the original one, then I'll mention it.And I did not "removed a couple of brackets and changed function names". I used the tutorial author's code to create mine. Isn't it the purpose of a tutorial ?Also, I'm not a great coder, and I've never done a 3D engine (even if it's only a raycaster) before that. So I have to train, and that's a training. It's absolutely not a finished program, it's a trial of an engine for a possible game.You are right, I should have given credits to the author. But what you say is a little excessive, don't you think so ?
Oh okay, sorry my bad. I first thought that the fact that the variables dirX, dirY, planeX, planeY, cameraX, rayPosX, rayPosY, rayDirX, rayDirY, sideDistX, sideDistY, perpWallDist, mapX, mapY, hit, stepX, stepY, deltaDistX, deltaDistY, side, drawStart and drawEnd have the exact same name and do exactly the same thing in Vandevenne's was a coincidence.