Frage

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

War es hilfreich?

Lösung

I'd say that if ScreenX/YCoordinates match as closely as they do, then your x,y input arguments have to be correct. Which leaves only a possible mismatch between the f(x,y) implementations. There's a possibility there is a numerical difference even if they look the same. Do the precisions match? Could the other software be using integer vs. floating point math?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top