# 3D projection in 2D using the light-source concept

To achieve 3D projection in 2D I use the light-source concept ( that I got to know in this forum it self ) , so basically I determine a light source with 3D coordinates $(0 ,0 , h)$ and so the 2D coordinates of a point $(x ,y ,z)$ are $$\left(x\ \frac{h}{h + z} ,y\ \frac{h}{h + z}\right) .$$ The question is:

Can I change the light source coordinates from $(0, 0, h)$ to $(h_1, h_2, h_3)$, and if it is possible, what will be the 2D coordinates resulting.

• Do a translation of the axes to move $(h_1,h_3,h_3)$ to $(0,0,h)$. – N74 Jun 2 '17 at 18:14
• And how can i do so ? In simple words please – Put Me Jun 2 '17 at 18:15
• I guess this is easily done with a transformation matrix, but what does this 2D point represent? – WalterJ Jun 2 '17 at 19:04
• I don't know yet what a transformation matrix is , i just completed my baccalauriat so my math bagage is still quiet small . For the point it's just an arbitrary point , make it a vector if you like . – Put Me Jun 3 '17 at 18:38

Sorry for the delay, now I found time to answer. As I told you in the comments make a translation of the axes before and after the projection: let $P\equiv(x, y, z)$, $L\equiv(h_1,h_2,h_3)$ and $Q$ be the projected point in 3D space.
First we translate to have only the third coordinate of the light source not null: $P'\equiv(x-h_1, y-h_2, z)$ and $L\equiv(0,0,h_3)$.
Now we can use your formula on $P',L'$: $Q'\equiv ((x-h_1) * {h _3 \over h_3 + z},(y -h_2)* {h _3\over h_3+ z}, 0)$.
Finally we translate $Q'$ in the opposite direction of the first translation: $Q\equiv ((x-h_1) * {h _3 \over h_3 + z}+h_1,(y -h_2)* {h _3\over h_3+ z}+h_2, 0)$.