0
votes

There is a point cloud inside a sphere of radius r, and the coordinate system of these points is in the center of the sphere. The idea is to "take photos" of this cloud since there are many points of view in the surface of the sphere. The "camera" position depends on the angles theta (azimuths) and phi (elevation), as shown in the image. I need at least 10000 images or points of view.

How could I handle this?

enter image description here

I have done:

Following this link I've projected the points to each plane as I also needed to visualize them in 3D. Like this:

enter image description here

So I have the coordinates of the projected points who belong to the plane of the "photo" but still with the original coordinate system.

The plane is defined by:

U = {-sin(theta), cos(theta), 0}
V = {cos(theta)*sin(phi), sin(theta)*sin(phi), cos(phi)}
Center = {cos(theta)*cos(phi), sin(theta)*cos(phi), sin(phi)}*r

But I am blocked passing from 3D to 2D.

2
I'm voting to close this question as off-topic because it is about linear algebra / coordinate system transformation / Mathematics instead of directly about programming or software development.Pang

2 Answers

2
votes

Each point P's projected coordinates in the plane's own basis [U, V] are given by

[x', y'] = [dot(P - Center, U), dot(P - Center, V)]

To convert this to world coordinates simply do

world_coord = Center + U * x' + V * y'

(Let me know if I've misunderstood your question)

0
votes

Imagine that left bottom of the screen is (0,0) in degrees, right bottom is (0,360) in degrees, left top is (180,0) in degrees and right top bottom is (180,360) in degrees. Theta will change from 0 to 360, phi will change from 0 to 180. You could project your point cloud data by calculating these angles and writing into pixels as points with desired rgb. Some pixels will have more than one point, the reason is that at the same angle there will be points with different lengths. According to these lengths you can create a depth map. Briefly, your coordinate system will change like theta and phi(length is optional for depth map).