Graphics - equation to convert 3d point to 2d projection

房东的猫 提交于 2019-12-01 04:09:45

问题


I am a graphics novice, but am playing with HTML5 Canvas, javascript and some shapes and images. If I have a camera at point C.x,C.y,C.z, and a point at P.x,P.y,P.z, what is the easiest way to convert the point to a 2d point so I can render an image at that point with the correct scaling so my perspective is correct? I'm after the equations, not a library.

Thanks!


回答1:


It is called the Perspective Projection and the formula you seek is just the matrix-multiplication found here:

http://en.wikipedia.org/wiki/3D_projection#Perspective_projection



来源:https://stackoverflow.com/questions/5276315/graphics-equation-to-convert-3d-point-to-2d-projection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!