2
$\begingroup$

Additional question to 3DSinghVFX's answer


To illustrate question - imagine this white/pink rectangles as rendered image of 6 x 3 pixels. Here seen by Camera.

enter image description here

Animation Node tree (mentioned in the answer) generates a compact surface.

enter image description here

My question is ...
How can be pixels (reconstructed in 3D space from Depth Pass or Point Position Map as points) represented by unconnected quads orientated to Camera. To be seen by Camera as regular squares without gaps so final result is identical to original image.

In theory, since those faces aka pixels are oriented to camera they are still squares and from mentioned answer also grid is nicely even to a camera view ... So the only question here is probably how calculate size according to distance from camera.

enter image description here

Sidenote: Surface generated by mentioned answer is awesome, downside of that menthod are connections between front-back pixels that are empty space in real. Since there is not a way to store this kind of data in EXR, it seems to be better use pixels as separated to get similar result.


I'm also interested in version with coloured Points (spheres) scaled accordingly to Camera distance, to be seen by camera as same size.

enter image description here

enter image description here

I would appreciate if you can use the same EXR source data from original Q.
Thank you for help.

$\endgroup$
4
  • $\begingroup$ @3DSinghVFX Now I see I could simplify whole the roman here into a singl question ... how to calculate size according to distance from camera? $\endgroup$
    – vklidu
    Commented Mar 15, 2021 at 23:23
  • $\begingroup$ @vkidu Hi. Do you need spheres for Point-Cloud and scaled them according to camera distance? $\endgroup$
    – 3DSinghVFX
    Commented Mar 18, 2021 at 17:06
  • $\begingroup$ Okay. I have done some tests with spheres, it looks promising. However, with planes to get an exact match with the original image, we have to stretch/shear them accordingly which is difficult. $\endgroup$
    – 3DSinghVFX
    Commented Mar 18, 2021 at 18:50
  • 1
    $\begingroup$ Very Sorry, I was very busy. There is a way, I'll answer this today. $\endgroup$
    – 3DSinghVFX
    Commented Apr 15, 2021 at 13:15

1 Answer 1

1
$\begingroup$

enter image description here

Method:

  1. The idea is to first compute the distance from the camera for all vertices of a polygon 2) then find the vertex that minimum distance from the camera 3) then project the remaining vertices of the polygon accordingly.
  1. Follow the Method for Depth Map with AN+EN to get this node-tree, enter image description here

  2. We compute the distance from the camera for all vertices of each polygon then reproject according to the vertex that has minimum distance from the camera. This will give a new polygon(s) that is perpendicular to the camera view, enter image description here

  3. Now, we have vertices for separated polygons and we can get polygon-indices and edge-indices with the help of the Separate Polygons node, enter image description here enter image description here

Blend File:


  1. To add spheres at the center of newly project polygons, first, we have to compute the scale according to the polygon size like so, enter image description here

  2. Then use Extract Polygon Transforms node to get the polygon transformation and use the Step 4 scale for matrices to instance spheres at the polygons' center, enter image description here enter image description here

Blend File:

$\endgroup$
2
  • 1
    $\begingroup$ WOW ... Thanks a lot for your time ... awesome result ... my toy for this weekend. I don't have ambition to understand the math behind ... I would be happy if I will be able to reuse it for my needs :) That seems to be easy. $\endgroup$
    – vklidu
    Commented Apr 16, 2021 at 20:49
  • $\begingroup$ You're welcome :) This method is performance-heavy. If I find some faster method then I'll add that too. $\endgroup$
    – 3DSinghVFX
    Commented Apr 16, 2021 at 21:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .