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.

  • $\begingroup$ Do a translation of the axes to move $(h_1,h_3,h_3)$ to $(0,0,h)$. $\endgroup$ – N74 Jun 2 '17 at 18:14
  • $\begingroup$ And how can i do so ? In simple words please $\endgroup$ – Put Me Jun 2 '17 at 18:15
  • $\begingroup$ I guess this is easily done with a transformation matrix, but what does this 2D point represent? $\endgroup$ – WalterJ Jun 2 '17 at 19:04
  • $\begingroup$ 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 . $\endgroup$ – 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)$.

Discard the third coordinate and you have your position in 2D space.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.