Forum

Pointcloud layer with Projector node


#1

Hallo
using the a Pointcloud generated by layer I am having a hard time to match the point cloud with its original object if I use the Projector node with some y-shift how to compensate for that and is there a way to calculate automatically the FOVxy ?

Pointcloud test.zip (15.5 MB)


#2

The easiest way is to use the camera that is included in the pointcloud pack.

see attached patch

Pointcloud test.zip (14.8 MB)


#3

Yes but my question is specific to the projector node, otherwise the only solution possible is to do an orthographic view of a texture rendered out the perspective of the projector node, but in this case I d lose the depth of the points.
Simone


#4

hi, i need to check that out, i think u might have projected texture calculation inside shader witch uses wrong formula

yea this place:

...
float4 pos = float4(0,0,0,1);
		pos.x = ((coord.x - 0.5) * depth * XtoZ );
		pos.y = ((0.5 - coord.y) * depth * YtoZ);
		pos.z = depth;
...

has to be changed with this:

float3 UVtoEYE(float2 UV){return normalize(mul(float4(mul(float4((UV.xy*2-1)*float2(1,-1),0,1),tPI).xy,1,0),tVI).xyz);}

in Data_CS_BuildPcb_Layer.fx

otherwise distorted projection matrix not gonna work