I am doing ray tracing and I have screen. I want to define it in the world coordinates
MaxPCx = 1;
MaxPCy = 1 / AspectRatio;
x = linspace(0,MaxPCy,Height_proj);
y = linspace(0,MaxPCx,Width_proj);
[CoordsY,CoordsX] = ndgrid(x,y);
% Convert Projector Coordinates To Screen Coordinates
ScreenXCoordinates = (CoordsX .* MaxPCxInv).* SizeX_scr + Screen_OffsetX;
ScreenYCoordinates = (1 - CoordsY .* MaxPCyInv ).* SizeY_scr + Screen_OffsetY;
ScreenZCoordinates = f(x,y) % this function is the same used in my software that I used exactly the same
So my problem now that I got the ScreenXCoordinates ,ScreenYCoordinates and ScreenZCoordinates from the software and I am comparing them with mine so the difference in x and y coordinates are fine in order of 10^-9 but the difference in z direction is really high in order of 10^-4 so Could anybody give me suggestion please.
and then I am applying the rotation matrix and translation vector for the convertion to the world coordinates
is the generation of the projector coordinates at the beginning (CoordsX and CoordsY) correct?
Many thanks in advance