Optimal number of points to plot a sphere

hi all,
I have thousands of data points in (x y z) format to represent the human eye. Since the human eye is modeled like a sphere, is there any way where i can reduce the number of data points to plot the human eye without any distortion of the shape?
Best Regards, natur3

 Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de Sept. de 2012

1 voto

Calculate the linear distance in pixel-widths between the center of the sphere and the edge. Using that as a radius, calculate the surface area in pixels. If you have more points than that surface area, you can prune back and still have full graphic representation at that drawing scale.
You can probably prune even further than that, but the calculation gets more difficult.

8 comentarios

Rick
Rick el 15 de Sept. de 2012
Hi,
What do you mean by prune back?
Best Regards, natur3
Walter Roberson
Walter Roberson el 15 de Sept. de 2012
"prune back" is to remove excess points not needed for the graphical representation.
Walter Roberson
Walter Roberson el 15 de Sept. de 2012
My calculation is that a view of a sphere with a 16 pixel radius corresponds to a surface area of over 3141 pixels. Therefore to the first approximation, you cannot reduce the number of data points from your "thousands" without distortion unless you are displaying the sphere as less than about 30 pixels wide. This is a first approximation only.
Rick
Rick el 15 de Sept. de 2012
wow, < 30 pixels wide is very small even though its an approximation.
seems like I can't afford to reduce the data points if i want to avoid distortion.
Walter Roberson
Walter Roberson el 15 de Sept. de 2012
A brief test with radius 15.5 <= R < 16.5 pixel-widths shows 3338 pixels on the surface, slightly more than 4*Pi*r^2 would predict.
Rick
Rick el 17 de Sept. de 2012
Editada: Rick el 17 de Sept. de 2012
Hi,
sorry for the late reply. Have been trying out and searching for info. I have some questions.
That is, how do I calculate in pixels width?
Whats the difference between "R" and "r"?
By having slightly more pixels on the surface as compared to 4*Pi*r^2, what does it imply?
Best regards, natur3
[X, Y, Z] = ndgrid(-18:18); %pixels
R = sqrt(X.^2 + Y.^2 + Z.^2);
onsurface = 15.5 <= R & R < 16.5;
nnz(onsurface)
gives 3338.
Here, "R" is the actual radius at each integer coordinate triple, whereas in 4*Pi*r^2 the "r" is the desired theoretical radius.
There are going to be only 6 integer coordinate triples whose distance is exactly 16: (-16,0,0), (16,0,0), (0,-16,0), (0,16,0), (0,0,-16), (0,0,16). In order to fill out the sphere, we need to select which integer triples are "effectively" at distance 16. I used the semi-open radius range [15.5, 16.5) in my test, selecting the points whose center lies in a thin shell between 15.5 (inclusive) and 16.5 (exclusive) away from the origin. This slightly over-selects points compared to the ideal 4*Pi*(16)^2 as a larger radius is being included and reachable points within a given distance expand with the cube of the radius. The best matching spherical shell should likely be a little thinner than 16.5 at maximum, possibly around 16.2
Rick
Rick el 17 de Sept. de 2012
I see.
So we can cut down the number of points where we take only the "R" which gives us the best matching surface area compared to the desired surface area?
If correct, the range that i used will be more accurate if i used smaller range?
Best regards, natur3

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 15 de Sept. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by