Now I have a 3D point cloud. And I want to convert it to 2D image that viewed from different directions. I think it may works following: (1) rotate the 3D model, (2) use Z-buffer to determine which points are visible, (2) project 3D model to 2D image. I have some problem with the second step, which is Z-buffer. Could someone give me some advice about how to do it?

9 commentaires

Walter Roberson
Walter Roberson le 9 Oct 2018
Do you have solid points of known size and orientation that block other points that are not exactly colinear? Or do you have an implied surface, and if so how tightly should the surface be assumed to follow the known points?
MENGZHI DI
MENGZHI DI le 9 Oct 2018
Sorry I haven't make my question clear enough. I don't have a complete 3D model (not a obj. file or similar file), but only the x,y,z 3 dimentional data, z is the height. I just want to use the z-buffer to determine which points should be seen and which are not.
Jan
Jan le 9 Oct 2018
It is still not clear. "Points" do not have an extent in theory. To conceal each other, you have to define at first, if "points" mean "spheres with a specific radius". Then you might mean an orthographic or perspectivic projection from 3D to 2D. What exactly do you mean by "the z-buffer"?
Walter Roberson
Walter Roberson le 9 Oct 2018
Points are infinitely small, and one would only be invisible if it was exactly behind another when looking in that particular view. Unless, that is, for your purpose, points are spheres or cubes or something else with finite size where part of a closer "point" might block part of one further away along the chosen axes -- or if for your purpose, the points are intended to sample the outside surface of something (such as for LIDAR) and you want to do hidden point removal.
MENGZHI DI
MENGZHI DI le 10 Oct 2018
Sorry I am new to this, I have the xyz 3 dimensional data. And want to use z-buffer to determine which points are visible from a certain viewpoint. Thank you for replying. I have gotten the code to do this.
yang zhang
yang zhang le 10 Fév 2020
How to get two-dimensional pictures with different angles?
yang zhang
yang zhang le 10 Fév 2020
Have you achieved all the above three steps? Can we talk? My email is 1198692934@qq.com
Walter Roberson
Walter Roberson le 10 Fév 2020
Given a viewpoint and a viewing angle, you do a translation of the point coordinates to be relative to the viewpoint, and then you do a rotation of the points to align viewpoint. Then any point that has a negative (local) Z coordinate is "behind your head" and cannot be seen, and every other point can be seen provided that it is not co-linear along that axes (if it is, then it projects to exactly the same local x and local y).
It is, however, not common to bother to compute these things yourself, as MATLAB does the computation automatically when you plot.
There is a closely related question having to do with how far an object is away from the viewpoint, in order to know how much detail to render the object at. However when doing that kind of calculation, you always have perspective, which the original question does not deal with. The computations to determine how much "Level of Detail" (LOD) for 3D scenes in virtual reality are typically handled by functions provided by the VR environment.
yang zhang
yang zhang le 11 Fév 2020
Can it be obtained automatically?

Connectez-vous pour commenter.

 Réponse acceptée

Walter Roberson
Walter Roberson le 9 Oct 2018

1 vote

4 commentaires

MENGZHI DI
MENGZHI DI le 10 Oct 2018
Thank you so much. I tried this code and it works. Still have one question, I am not very clear about how to choose the proper parameter R.
Walter Roberson
Walter Roberson le 10 Oct 2018
The code allows you to choose param but not R. Apparently the paper describes what it means.
yang zhang
yang zhang le 10 Fév 2020
How should this code be used, can you give an example?
yang zhang
yang zhang le 11 Fév 2020
Your answer is important to me

Connectez-vous pour commenter.

Plus de réponses (1)

yang zhang
yang zhang le 10 Fév 2020

0 votes

Have you achieved all the above three steps? Can we talk? My email is 1198692934@qq.com

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by